Wrong Boolean condition token - Jenkins - jenkins

I don't know how to put a conditioned token to evaluate if a file exists with the Conditional Step Plugin in Jenkins:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.479 s
[INFO] Finished at: 2017-09-05T12:57:09+02:00
[INFO] Final Memory: 16M/56M
[INFO] ------------------------------------------------------------------------
Exception caught evaluating condition: [org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'test_resultados_miniprueba' in '$test_resultados_miniprueba'], action = [Don't run]
Finished: SUCCESS
What is the error in the condition token?
Thanks so much for your time!!!!

In your case $test_resultados_miniprueba does not resolve to anything, i.e. it is not a token or environment variable. It seems you wish to test if a file exists? That can be done with the 'File Exists' condition.
The Conditional Buildstep Plugin uses the Run Condition Plugin internally, so you can get a little bit more of documentation there.

Related

Set Jenkins build to stable using Allure/surefire-plugin & cucumber when 95% of the tests passes

The build is turned yellow even if one test has failed and that annoying. I want to build to turn to unstable only if lass than 95% of the tests has failed.
Is there a way to force the jenkins build to be stable when using Allure/surefire-plugin & cucumber?
enter image description here
[INFO]
[INFO] Results:
[INFO]
[WARNING] Flakes:
[WARNING] inloggen.Controlle verplichte velden inlogpagina
[INFO] Run 1: PASS
[INFO] Run 2: PASS
[ERROR] Run 3: Kan de tekst "Er is een authenticatie fout opgetreden" niet vinden!
[ERROR] Run 4: Kan de tekst "Er is een authenticatie fout opgetreden" niet vinden!
[INFO]
[INFO]
[WARNING] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Flakes: 1
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M5:verify (default) # XXX---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # XXX_cucumber_integratietests ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\jenkins\workspace\XXX_CucumberIntegrationTestPipe\clone\test\functional\cucumber\XXX_cucumber_integratietests\target\XXX_cucumber_integratietests-1.2-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min (Wall Clock)
[INFO] Finished at: 2020-09-14T15:33:44+02:00
[INFO] ------------------------------------------------------------------------
[XXX_CucumberIntegrationTestPipe] $ C:\ws\allure-2.13.5\bin\allure.bat generate C:\jenkins\workspace\XXX_CucumberIntegrationTestPipe\clone\test\functional\cucumber\XXX_cucumber_integratietests\target\allure-results -c -o C:\jenkins\workspace\XXXCucumberIntegrationTestPipe\clone\test\functional\cucumber\target\allure-report
Report successfully generated to C:\jenkins\workspace\XXX_CucumberIntegrationTestPipe\clone\test\functional\cucumber\target\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Build step 'Allure Report' changed build result to UNSTABLE
Finished: UNSTABLE
Setting the threadshold to 95% is not possible in Maven. The Maven does not have such ambition. It can be configured only in Jenkins CI.

setting spring.profiles.active in OS X

I want to set the variable spring.profiles.active in order to create a package from the command line accordingly, but I don't know how to do it
MacBook-Pro-de-nunito:tdk calzada$ export spring.profiles.active=war,pebloc
-bash: export: `spring.profiles.active=war,pebloc': not a valid identifier
I have also another one
MacBook-Pro-de-nunito:tdk calzada$ export APP-KEY=pebloc
-bash: export: `APP-KEY=pebloc': not a valid identifier
After trying the proposed solution, the active profiles are empty
MacBook-Pro-de-nunito:tdk calzada$ export SPRING_PROFILE_ACTIVE=war,sebloc
MacBook-Pro-de-nunito:tdk calzada$ mvn help:active-profiles
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.tdk:tdk:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-web:jar -> duplicate declaration of version (?) # line 70, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tdk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:active-profiles (default-cli) # tdk ---
[INFO]
Active Profiles for Project 'com.tdk:tdk:jar:0.0.1-SNAPSHOT':
The following profiles are active:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.491 s
[INFO] Finished at: 2017-03-15T19:23:01+01:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
Wouldn't be better to define this variables when you package the app. ?
mvn clean package -DskipTests -Dspring.profiles.active=pebloc,war -DAPP-KEY=pebloc

Why does a Maven 3 multi-module project fail on "clean package", and succeed on "clean compile" followed by "package"?

This is similar to the asked and answered question Maven test dependency on multi module project. However, this has nothing to do with the test phase, instead I'm having problems with package.
I have a multi-module project something like:
root
|
|-parent-client
| |
| |-client-1
| |
| \-client-2
|
\-parent-server
|
|-server-1
|
|-server-2
|
|-server-3
|
\-server-4
My dependencies are client-1 -> client-2 -> server-1 -> server-2 -> server-3 -> server-4, which is to say that client-2 depends on server-1, server-1 depends on server-2, and so on. Each is scoped to compile.
So the problem is that when I run mvn clean package in the root, I get a compilation failure in server-2 that package server-3 does not exist.
When I run mvn clean compile followed by mvn package in the root, it runs through without issue.
It always fails at the same module when it fails.
My understanding of the Build Lifecycle is that compile package is redundant since package includes the compile lifecycle.
The project is more complex, with a total of 41 modules, two parents and one root. Creating a simple example inevitably works as expected.
I'm stumped as to how I should proceed.
Update 2015-10-25
Turns out I was wrong about the order of commands for success. I've updated my question and the description, and included debug output per Michael-O's request:
<snip/>
[INFO] --- maven-ejb-plugin:2.3:ejb (default-ejb) # terradatum-systemconfig ---
[INFO] Building EJB terradatum-systemconfig-4.8.1-SNAPSHOT with EJB version 3.0
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT.jar
[INFO] Building EJB client terradatum-systemconfig-4.8.1-SNAPSHOT-client
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT-client.jar
<snip/>
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building terradatum-payment 4.8.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # terradatum-payment ---
[INFO] Deleting /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # terradatum-payment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # terradatum-payment ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/src/main/java/com/terradatum/common/payment/PaymentRemoteDelegate.java:[13,42] package com.terradatum.common.systemconfig does not exist
<snip/>
Update 2015-11-16
After much refactoring the build no longer fails in the same place. I've seen it fail in a similar way, consistently, but the location of the failure moves around. I am not running multiple threads, but it seems very clear to me there's a race somewhere in which an obviously available package (absolutely located and reachable in my ~/.m2/repository local cache, and added to the classpath) is not visible to the Maven compiler.
And knowing what I know about race conditions, I have no idea how I would file a bug report of any substance given I can't offer anything more than supposition and finger pointing.

maven build failure- Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin

I am trying to build CDAP source code by following article from below location-
https://github.com/caskdata/cdap
But when I try mvn clean package, It will gives build error-
.
.
kConfigurer.java:69: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowForkNode.java:21: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowSpecification.java:30: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowToken.java:22: First sentence should end with a period.
Audit done.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Cask Data Application Platform (CDAP) ............. SUCCESS [1:52.768s]
[INFO] CDAP API .......................................... FAILURE [1:03.487s]
[INFO] CDAP Watchdog API ................................. SKIPPED
[INFO] CDAP Protocol ..................................... SKIPPED
[INFO] CDAP Build Common ................................. SKIPPED
[INFO] CDAP Common ....................................... SKIPPED
[INFO] CDAP Notifications APIs ........................... SKIPPED
[INFO] CDAP Explore Client ............................... SKIPPED
[INFO] CDAP Data-Fabric .................................. SKIPPED
[INFO] CDAP Watchdog ..................................... SKIPPED
[INFO] CDAP Notifications ................................ SKIPPED
[INFO] CDAP HBase 0.96 Compatibility ..................... SKIPPED
[INFO] CDAP Data-Fabric Tests ............................ SKIPPED
[INFO] CDAP Java Client .................................. SKIPPED
[INFO] CDAP Test Framework ............................... SKIPPED
[INFO] CDAP App-Fabric ................................... SKIPPED
[INFO] CDAP Explore JDBC Driver .......................... SKIPPED
[INFO] CDAP Explore ...................................... SKIPPED
[INFO] CDAP Unit Test Framework .......................... SKIPPED
[INFO] CDAP CLI .......................................... SKIPPED
[INFO] CDAP Security ..................................... SKIPPED
[INFO] CDAP Gateway ...................................... SKIPPED
[INFO] CDAP UI ........................................... SKIPPED
[INFO] CDAP Standalone ................................... SKIPPED
[INFO] CDAP Java Client Tests ............................ SKIPPED
[INFO] CDAP CLI Tests .................................... SKIPPED
[INFO] CDAP Kafka Server ................................. SKIPPED
[INFO] CDAP HBase 0.94 Compatibility ..................... SKIPPED
[INFO] CDAP HBase 0.98 Compatibility ..................... SKIPPED
[INFO] CDAP Master ....................................... SKIPPED
[INFO] CDAP Distributions ................................ SKIPPED
[INFO] CDAP Application Archetypes ....................... SKIPPED
[INFO] CDAP Spark Java Archetype ......................... SKIPPED
[INFO] CDAP Spark Scala Archetype ........................ SKIPPED
[INFO] CDAP Application Archetype ........................ SKIPPED
[INFO] CDAP Integration Test Framework ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:35.198s
[INFO] Finished at: Sat May 23 18:56:07 IST 2015
[INFO] Final Memory: 27M/100M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-
plugin:2.12.1:check (validate) on project cdap-api: Failed during checkstyle execution:
There are 68 checkstyle errors. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cdap-api C:\Users\admin\cdap>
Please suggest what may be cause of this build failure.
Regards
kConfigurer.java:69: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowForkNode.java:21: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowSpecification.java:30: First sentence should end with a period.
C:\Users\admin\cdap\cdap-api\src\main\java\co\cask\cdap\api\workflow\WorkflowToken.java:22: First sentence should end with a period.
I think in the class kConfigurer.java on line 69, the first sentence in the comment should end with a full stop.
Similar with the other 3 statements.
Check out
"First sentence should end with a period."
or
http://apps.topcoder.com/forums/?module=Thread&threadID=505624&start=0&mc=9
if you're confused.
Checkstyle is mostly there so your code looks uniform, so be aware it'll do this often. Thankfully it's usually simple to fix.
This error indicates a problem with checkstyle where the First line with comment is not ending with a period on the lines highlighted. However specific to this project, I don't see any error building from develop.
1) Are you not building from develop branch?
2) Have you modified the suppressions.xml file? - The suppressions.xml line number 30 has disabled this check < suppress checks="JavadocStyle" files="./src/(main|integration)/java/." / >. So unless you have modified that file, you should not be seeing this specific checkstyle error.
3) There is no file called kConfigurer.java in the project. Perhaps it is best to remove all the files not related to CDAP before giving it a try.
Thanks,
Sree

Error building carbon component

I have been doing http://wso2.com/library/tutorials/2014/03/how-to-write-a-wso2-carbon-component/ but when I create client using wsdl file I got this error. How can I solve this issue.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WSO2 Carbon - Student Manager Stub 4.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:add-source (add-source) # org.wso2.carbon.student.mgt.stub ---
[INFO] Source directory: /home/jobs/wso2/Carbon/Old/org.wso2.carbon.student.mgt.stub/target/generated-code/src added.
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # org.wso2.carbon.student.mgt.stub ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-antrun-plugin:1.1:run (source-code-generation) # org.wso2.carbon.student.mgt.stub ---
[INFO] Executing tasks
[java] Retrieving document at 'src/main/resources/StudentManager.wsdl'.
[java] Dec 05, 2014 1:05:42 AM org.apache.axis2.schema.SchemaCompiler compile
[java] WARNING: No schemaLocation for import of http://data.mgt.student.carbon.wso2.org/xsd; compilation may fail
[INFO] Executed tasks
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # org.wso2.carbon.student.mgt.stub ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 8 source files to /home/jobs/wso2/Carbon/Old/org.wso2.carbon.student.mgt.stub/target/classes
Actually what is this warning means? This where what I cant understand ..
[java] WARNING: No schemaLocation for import of http://data.mgt.student.carbon.wso2.org/xsd; compilation may fail
It looks like domain class has not been updated in ../data/xsd directory in the target code. I suspect that the backend component has been updated and the wsdl has been altered, but the stub has not been updated/created yet. Therefore the client side component doesn't aware of the modifications. I suggest that you may update the wsdl file in stub resources and rebuilding the stub and client should probably solve the issue.

Resources