Is there a way to porsue with maven build after running wildfly:run goal? - maven

I would like to complete Maven build lifecycle after wildfly:run goal's execution.
The fact is that wildfly:run goal starts a standalone application server and from that point the CLI shows Wildfly's Log messages only.
[INFO] --- wildfly-maven-plugin:2.1.0.Beta1-SNAPSHOT:run (default) # PrimeFaces1 ---
[WARNING] The POM for org.wildfly.plugins:wildfly-plugin-core:jar:2.1.0.Beta1-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] JAVA_HOME : C:\Program Files\Java\jdk1.8.0_201\jre
[INFO] JBOSS_HOME: C:\Users\Consul19\eclipse-workspace\MultiRunTest\PrimeFaces1\target\wildfly-18.0.1.Final
[INFO] JAVA_OPTS : -Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djboss.modules.system.pkgs=org.jboss.byteman
[INFO] Server is starting up. Press CTRL + C to stop the server.
[INFO] JBoss Threads version 2.3.3.Final
[INFO] JBoss Remoting version 5.0.12.Final
[INFO] XNIO version 3.7.2.Final
[INFO] XNIO NIO Implementation Version 3.7.2.Final
[INFO] ELY00001: WildFly Elytron version 1.9.1.Final
13:04:25,585 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final
13:04:26,228 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
13:04:26,248 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
13:04:26,472 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) starting
13:04:27,800 INFO [org.wildfly.security] (ServerService Thread Pool -- 28) ELY00001: WildFly Elytron version 1.10.4.Final
Actually I would like to run next goals but the server takes control of the CLI
Besides, in the pom.xml, I've tried to sobstitute wildfly:run with the wildfly:deploy goal, which deploy the artifact on the local JBOSS server(already started), And in this case the maven build goes on until the end.
[INFO] --- maven-war-plugin:2.2:war (default-war) # PrimeFaces1 ---
[INFO] Packaging webapp
[INFO] Assembling webapp [PrimeFaces1] in [C:\Users\Consul19\eclipse-workspace\MultiRunTest\PrimeFaces1\target\PrimeFaces1-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Consul19\eclipse-workspace\MultiRunTest\PrimeFaces1\src\main\webapp]
[INFO] Webapp assembled in [128 msecs]
[INFO] Building war: C:\Users\Consul19\eclipse-workspace\MultiRunTest\PrimeFaces1\target\PrimeFaces1-1.0-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] <<< wildfly-maven-plugin:2.1.0.Beta1-SNAPSHOT:deploy (default-cli) < package # PrimeFaces1 <<<
[INFO]
[INFO]
[INFO] --- wildfly-maven-plugin:2.1.0.Beta1-SNAPSHOT:deploy (default-cli) # PrimeFaces1 ---
[INFO] JBoss Threads version 2.3.3.Final
[INFO] JBoss Remoting version 5.0.12.Final
[INFO] XNIO version 3.7.2.Final
[INFO] XNIO NIO Implementation Version 3.7.2.Final
[INFO] ELY00001: WildFly Elytron version 1.9.1.Final
[INFO]
[INFO] --------------------< com.mkyong.core:PrimeFaces2 >---------------------
[INFO] Building PrimeFaces2 1.0-SNAPSHOT [3/3]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> wildfly-maven-plugin:2.1.0.Beta1-SNAPSHOT:deploy (default-cli) > package # PrimeFaces2 >>>
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # PrimeFaces2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Consul19\eclipse-workspace\MultiRunTest\PrimeFaces2\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # PrimeFaces2 ---
[INFO] Nothing to compile - all classes are up to date
As you can see in this case the deploy goal doesn't "lock" the CLI but the build process still continues until the end

This behaviour is expected for the wildfly:run command, you're supposed to interrupt the server from the outside once you're done testing. Quoting the goal's documentation,
This goal will block until cancelled or a shutdown is invoked from a management client.
If that doesn't suit you, you can instead use wildlfy:start followed by wildfly:deploy.

Related

Test file is not running via maven on azure pipeline

I'm using maven for building the automation project and using junit for running my test scripts . Its BBD framework where we have feature file, stepdefinition page.I have created pipeline , agent on azure devops . When running the pipeline it showing as build successful but still no tests cases are running .
Logs in maven :-
2022-10-07T13:21:37.3334382Z ##[section]Starting: Maven SmartBots/pom.xml
2022-10-07T13:21:37.3341187Z ==============================================================================
2022-10-07T13:21:37.3341428Z Task : Maven
2022-10-07T13:21:37.3341633Z Description : Build, test, and deploy with Apache Maven
2022-10-07T13:21:37.3341821Z Version : 3.169.2
2022-10-07T13:21:37.3341987Z Author : Microsoft Corporation
2022-10-07T13:21:37.3342231Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/maven
2022-10-07T13:21:37.3342495Z ==============================================================================
2022-10-07T13:21:38.2158528Z [command]/usr/bin/mvn -version
2022-10-07T13:21:38.2158912Z Apache Maven 3.5.4 (Red Hat 3.5.4-5)
2022-10-07T13:21:38.2159093Z Maven home: /usr/share/maven
2022-10-07T13:21:38.2159584Z Java version: 1.8.0_345, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.345.b01-1.el8_6.x86_64/jre
2022-10-07T13:21:38.2160036Z Default locale: en_US, platform encoding: UTF-8
2022-10-07T13:21:38.2160548Z OS name: "linux", version: "4.18.0-372.26.1.el8_6.x86_64", arch: "amd64", family: "unix"
2022-10-07T13:21:38.2163101Z SYSTEMVSSCONNECTION exists true
2022-10-07T13:21:38.2164119Z [command]/usr/bin/mvn -f /E/azdosagents/agent2/_work/113/s/SmartBots/pom.xml test
2022-10-07T13:21:38.7149886Z [INFO] Scanning for projects...
2022-10-07T13:21:38.7906399Z [INFO]
2022-10-07T13:21:38.7921739Z [INFO] ------------------------< com.company:SmartBots >-------------------------
2022-10-07T13:21:38.7923753Z [INFO] Building com.optum.ManualTracker 0.1.1-SNAPSHOT
2022-10-07T13:21:38.7925045Z [INFO] --------------------------------[ jar ]---------------------------------
2022-10-07T13:21:39.7344370Z [INFO]
2022-10-07T13:21:39.7433482Z [INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SmartBots ---
2022-10-07T13:21:39.7994520Z [INFO] Using 'UTF-8' encoding to copy filtered resources.
2022-10-07T13:21:39.8047081Z [INFO] Copying 21 resources
2022-10-07T13:21:39.8074402Z [INFO]
2022-10-07T13:21:39.8075718Z [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SmartBots ---
2022-10-07T13:21:39.8834648Z [INFO] Nothing to compile - all classes are up to date
2022-10-07T13:21:39.8835474Z [INFO]
2022-10-07T13:21:39.8836068Z [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SmartBots ---
2022-10-07T13:21:39.8901220Z [INFO] Using 'UTF-8' encoding to copy filtered resources.
2022-10-07T13:21:39.8901907Z [INFO] skip non existing resourceDirectory /E/azdosagents/agent2/_work/113/s/SmartBots/src/test/resources
2022-10-07T13:21:39.8902441Z [INFO]
2022-10-07T13:21:39.8902979Z [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # SmartBots ---
2022-10-07T13:21:39.8903395Z [INFO] No sources to compile
2022-10-07T13:21:39.8903634Z [INFO]
2022-10-07T13:21:39.8904175Z [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # SmartBots ---
2022-10-07T13:21:39.9333349Z [INFO] ------------------------------------------------------------------------
2022-10-07T13:21:39.9334415Z [INFO] BUILD SUCCESS
2022-10-07T13:21:39.9334944Z [INFO] ------------------------------------------------------------------------
2022-10-07T13:21:39.9335464Z [INFO] Total time: 1.237 s
2022-10-07T13:21:39.9337421Z [INFO] Finished at: 2022-10-07T08:21:39-05:00
2022-10-07T13:21:39.9338075Z [INFO] ------------------------------------------------------------------------
2022-10-07T13:21:40.0354312Z No test result files matching /E/azdosagents/agent2/_work/113/s/**/surefire-reports/TEST-*.xml were found, so publishing JUnit test results is being skipped.
2022-10-07T13:21:40.0408313Z ##[section]Finishing: Maven SmartBots/pom.xml

How to find the problem when a maven packaging stage last indefinitely?

I have a fairly large maven project that if compiled (using mvn package or mvn install), stuck on a packaging stage for 10+ hours:
[INFO] Building jar: /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- maven-source-plugin:3.1.0:jar-no-fork (attach-sources) # spookystuff-mldsl ---
[INFO] Building jar: /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-source-plugin:3.1.0:test-jar-no-fork (attach-sources) # spookystuff-mldsl ---
[INFO] Building jar: /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-test-sources.jar
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:test-jar (default) # spookystuff-mldsl ---
[INFO] Building jar: /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-tests.jar
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # spookystuff-mldsl ---
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT.jar to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT.jar
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/.flattened-pom.xml to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT.pom
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-javadoc.jar to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT-javadoc.jar
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-sources.jar to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT-sources.jar
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-test-sources.jar to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT-test-sources.jar
[INFO] Installing /home/peng/git-dev/scala-2.11/datapassports/spookystuff/mldsl/target/spookystuff-mldsl-0.6.2-SNAPSHOT-tests.jar to /home/peng/.m2/repository/com/tribbloids/spookystuff/spookystuff-mldsl/0.6.2-SNAPSHOT/spookystuff-mldsl-0.6.2-SNAPSHOT-tests.jar
(this is the last line of output)
The build output can be observed on CI server, with similar output:
https://app.codeship.com/projects/166836/builds/48698210?pipeline=103aace8-047a-47e4-9cb9-018c3ce0693a
I don't know what have caused this behaviour, but I suspect that a bug in maven-shade-plugin has caused dependency reduced pom generation to move into a indefinitely loop. How can I confirm this hypothesis collect enough evidence to report to the plugin maintainers?

Heroku: Spring boot app successfully deploying; but receiving application error when loading site

I would like to deploy my Spring boot app on Heroku.
When i try the manual deploy, there is no error on my log. But when i try to load the site i have this error:
Application error
An error occurred in the application and your page could not be served. If you are the application
owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
Please find below my logs.
Someone have an idea ?
did i miss some thing?
Any help would be welcome!
-----> Java app detected
-----> Installing JDK 1.8... done
-----> Executing Maven
$ ./mvnw -DskipTests clean dependency:list install
/tmp/build_3329cfca5f2723d7e41de818bf56c89f
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< lu.amundi:ServeurAmundiFileIntegration >---------------
[INFO] Building ServeurAmundiFileIntegration 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) # ServeurAmundiFileIntegration ---
[INFO]
[INFO] --- maven-dependency-plugin:3.0.2:list (default-cli) # ServeurAmundiFileIntegration ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) # ServeurAmundiFileIntegration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # ServeurAmundiFileIntegration ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 64 source files to /tmp/build_3329cfca5f2723d7e41de818bf56c89f/target/classes
[INFO] /tmp/build_3329cfca5f2723d7e41de818bf56c89f/src/main/java/lu/amundi/be/security/SecurityConfig.java: Some input files use or override a deprecated API.
[INFO] /tmp/build_3329cfca5f2723d7e41de818bf56c89f/src/main/java/lu/amundi/be/security/SecurityConfig.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) # ServeurAmundiFileIntegration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build_3329cfca5f2723d7e41de818bf56c89f/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # ServeurAmundiFileIntegration ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /tmp/build_3329cfca5f2723d7e41de818bf56c89f/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # ServeurAmundiFileIntegration ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) # ServeurAmundiFileIntegration ---
[INFO] Building jar: /tmp/build_3329cfca5f2723d7e41de818bf56c89f/target/ServeurAmundiFileIntegration-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) # ServeurAmundiFileIntegration ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ServeurAmundiFileIntegration ---
[INFO] Installing /tmp/build_3329cfca5f2723d7e41de818bf56c89f/target/ServeurAmundiFileIntegration-0.0.1-SNAPSHOT.jar to /app/tmp/cache/.m2/repository/lu/amundi/ServeurAmundiFileIntegration/0.0.1-SNAPSHOT/ServeurAmundiFileIntegration-0.0.1-SNAPSHOT.jar
[INFO] Installing /tmp/build_3329cfca5f2723d7e41de818bf56c89f/pom.xml to /app/tmp/cache/.m2/repository/lu/amundi/ServeurAmundiFileIntegration/0.0.1-SNAPSHOT/ServeurAmundiFileIntegration-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.676 s
[INFO] Finished at: 2020-04-07T14:07:09Z
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 78.8M
-----> Launching...
Released v6
https://amundi-file-integration-server.herokuapp.com/ deployed to Heroku
You have to run heroku logs --tail -a (your app name) to get access to the logs, that should have some information on why it is failing.
Try web:node server.js Not space web: node server.js in ProcFile

Fail to copy with Jenkins (MDEP-187)

I'm using Jenkins to build the Jenkins code in the GitHub repository but I'm having a problem:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Jenkins war 1.626
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # jenkins-war ---
[INFO] Deleting C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-maven) # jenkins-war ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:display-info (display-info) # jenkins-war ---
[INFO] Maven Version: 3.3.3
[INFO] JDK Version: 1.7.0_79 normalized as: 1.7.0-79
[INFO] OS Info: Arch: amd64 Family: windows Name: windows 8.1 Version: 6.3
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (default) # jenkins-war ---
[INFO] Adding ignore: org.eclipse.jetty.spdy.*
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-banned-dependencies) # jenkins-war ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:timestamp-property (timestamp-property) # jenkins-war ---
[INFO] Setting property 'now' to '08/30/2015 18:58 GMT'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:regex-property (version-property) # jenkins-war ---
[INFO] No match to regex '-SNAPSHOT' found in '1.626'.
[INFO] Setting property 'build.version' to '1.626'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) # jenkins-war ---
[INFO] Source directory: C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target\generated-sources\localizer added.
[INFO]
[INFO] --- gmaven-plugin:1.5-jenkins-3:generateStubs (default) # jenkins-war ---
[INFO] No sources found for Java stub generation
[INFO]
[INFO] --- maven-dependency-plugin:2.8:list (list-dependencies) # jenkins-war ---
[INFO]
[INFO] --- maven-dependency-plugin:2.8:unpack-dependencies (executable-war-header) # jenkins-war ---
[INFO] Unpacking C:\.m2\repository\org\jenkins-ci\executable-war\1.30\executable-war-1.30.jar to C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target\jenkins with includes "**/*.class" and excludes ""
[INFO]
[INFO] --- maven-dependency-plugin:2.8:copy (resgen) # jenkins-war ---
[INFO] Configured Artifact: org.jenkins-ci.main:remoting:?:jar
[INFO] Configured Artifact: org.jenkins-ci.main:remoting:?:jar
[INFO] Configured Artifact: org.jenkins-ci.main:cli:jar-with-dependencies:?:jar
[INFO] Configured Artifact: org.jenkins-ci:winstone:?:jar
[INFO] Configured Artifact: org.jenkins-ci.main:maven-plugin:?:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:ssh-slaves:1.9:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:credentials:1.18:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:ssh-credentials:1.10:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:subversion:1.54:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:cvs:2.11:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:ant:1.2:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:javadoc:1.1:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:translation:1.10:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:external-monitor-job:1.4:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:ldap:1.11:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:pam-auth:1.1:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:mailer:1.11:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:matrix-auth:1.1:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:windows-slaves:1.0:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:antisamy-markup-formatter:1.1:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:matrix-project:1.4.1:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:script-security:1.13:hpi
[INFO] Configured Artifact: org.jenkins-ci.plugins:junit:1.2-beta-4:hpi
[INFO] Copying remoting-2.52.jar to C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target\jenkins\WEB-INF\remoting.jar
[INFO] Copying remoting-2.52.jar to C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target\jenkins\WEB-INF\slave.jar
[INFO] Copying classes to C:\Program Files (x86)\Jenkins\workspace\jenkins_scc12_test\war\target\jenkins\WEB-INF\jenkins-cli.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Jenkins main module ................................ SUCCESS [ 2.497 s]
[INFO] Jenkins cli ........................................ SUCCESS [ 6.507 s]
[INFO] Jenkins core ....................................... SUCCESS [12:32 min]
[INFO] Jenkins war ........................................ FAILURE [ 10.954 s]
[INFO] Test harness for Jenkins and plugins ............... SKIPPED
[INFO] Jenkins plugin POM ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:55 min
[INFO] Finished at: 2015-08-31T02:58:30+08:00
[INFO] Final Memory: 179M/740M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (resgen) on project jenkins-war: Artifact has not been packaged yet. When used on reactor artifact, copy should be executed after packaging: see MDEP-187. -> [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 :jenkins-war
Build step 'Invoke top-level Maven targets' marked build as failure
Recording test results
Finished: FAILURE
The code I'm using is of the last release: https://github.com/jenkinsci/jenkins/tree/8d8703a781f83be19086592e0c8fa4b4c14da13c
I'm using Maven to build.
I'm very new to this. Please help me to solve this problem.
JDK version: 1.7.0
Maven version: 3.3.3

How to build Spark 1.2 with Maven (gives java.io.IOException: Cannot run program "javac")?

I am trying to build Spark 1.2 with Maven. My goal is to use PySpark with YARN on Hadoop 2.2.
I saw that this was only possible by building Spark with Maven. First, is this true?
If it is true, what is the problem in the log below? How do I correct this?
C:\Spark\spark-1.2.0>mvn -Pyarn -Phadoop-2.2 -Dhadoop.version=2.2.0 -DskipTests
clean package
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Spark Project Parent POM
[INFO] Spark Project Networking
[INFO] Spark Project Shuffle Streaming Service
[INFO] Spark Project Core
[INFO] Spark Project Bagel
[INFO] Spark Project GraphX
[INFO] Spark Project Streaming
[INFO] Spark Project Catalyst
[INFO] Spark Project SQL
[INFO] Spark Project ML Library
[INFO] Spark Project Tools
[INFO] Spark Project Hive
[INFO] Spark Project REPL
[INFO] Spark Project YARN Parent POM
[INFO] Spark Project YARN Stable API
[INFO] Spark Project Assembly
[INFO] Spark Project External Twitter
[INFO] Spark Project External Flume Sink
[INFO] Spark Project External Flume
[INFO] Spark Project External MQTT
[INFO] Spark Project External ZeroMQ
[INFO] Spark Project External Kafka
[INFO] Spark Project Examples
[INFO] Spark Project YARN Shuffle Service
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spark Project Parent POM 1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # spark-parent ---
[INFO] Deleting C:\Spark\spark-1.2.0\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) # spark-parent
---
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-scala-sources) # spark-
parent ---
[INFO] Source directory: C:\Spark\spark-1.2.0\src\main\scala added.
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) # spark-parent --
-
[INFO]
[INFO] --- scala-maven-plugin:3.2.0:compile (scala-compile-first) # spark-parent
---
[INFO] No sources to compile
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-test-source (add-scala-test-sources
) # spark-parent ---
[INFO] Test Source directory: C:\Spark\spark-1.2.0\src\test\scala added.
[INFO]
[INFO] --- scala-maven-plugin:3.2.0:testCompile (scala-test-compile-first) # spa
rk-parent ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-dependency-plugin:2.9:build-classpath (default) # spark-parent
---
[INFO] Wrote classpath file 'C:\Spark\spark-1.2.0\target\spark-test-classpath.tx
t'.
[INFO]
[INFO] --- gmavenplus-plugin:1.2:execute (default) # spark-parent ---
[INFO] Using Groovy 2.3.7 to perform execute.
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) # spark-p
arent ---
[INFO]
[INFO] --- maven-shade-plugin:2.2:shade (default) # spark-parent ---
[INFO] Including org.spark-project.spark:unused:jar:1.0.0 in the shaded jar.
[INFO] Replacing original artifact with shaded artifact.
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar-no-fork (create-source-jar) # spark-par
ent ---
[INFO]
[INFO] --- scalastyle-maven-plugin:0.4.0:check (default) # spark-parent ---
[WARNING] sourceDirectory is not specified or does not exist value=C:\Spark\spar
k-1.2.0\src\main\scala
Saving to outputFile=C:\Spark\spark-1.2.0\scalastyle-output.xml
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 32 ms
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spark Project Networking 1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # spark-network-common_2
.10 ---
[INFO] Deleting C:\Spark\spark-1.2.0\network\common\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) # spark-networ
k-common_2.10 ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-scala-sources) # spark-
network-common_2.10 ---
[INFO] Source directory: C:\Spark\spark-1.2.0\network\common\src\main\scala adde
d.
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) # spark-network-c
ommon_2.10 ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # spark-netw
ork-common_2.10 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Spark\spark-1.2.0\network\common\s
rc\main\resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- scala-maven-plugin:3.2.0:compile (scala-compile-first) # spark-networ
k-common_2.10 ---
[WARNING] Zinc server is not available at port 3030 - reverting to normal increm
ental compile
[INFO] Using incremental compilation
[INFO] compiler plugin: BasicArtifact(org.scalamacros,paradise_2.10.4,2.0.1,null
)
[INFO] Compiling 42 Java sources to C:\Spark\spark-1.2.0\network\common\target\s
cala-2.10\classes...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spark Project Parent POM ........................... SUCCESS [ 5.267 s]
[INFO] Spark Project Networking ........................... FAILURE [ 1.922 s]
[INFO] Spark Project Shuffle Streaming Service ............ SKIPPED
[INFO] Spark Project Core ................................. SKIPPED
[INFO] Spark Project Bagel ................................ SKIPPED
[INFO] Spark Project GraphX ............................... SKIPPED
[INFO] Spark Project Streaming ............................ SKIPPED
[INFO] Spark Project Catalyst ............................. SKIPPED
[INFO] Spark Project SQL .................................. SKIPPED
[INFO] Spark Project ML Library ........................... SKIPPED
[INFO] Spark Project Tools ................................ SKIPPED
[INFO] Spark Project Hive ................................. SKIPPED
[INFO] Spark Project REPL ................................. SKIPPED
[INFO] Spark Project YARN Parent POM ...................... SKIPPED
[INFO] Spark Project YARN Stable API ...................... SKIPPED
[INFO] Spark Project Assembly ............................. SKIPPED
[INFO] Spark Project External Twitter ..................... SKIPPED
[INFO] Spark Project External Flume Sink .................. SKIPPED
[INFO] Spark Project External Flume ....................... SKIPPED
[INFO] Spark Project External MQTT ........................ SKIPPED
[INFO] Spark Project External ZeroMQ ...................... SKIPPED
[INFO] Spark Project External Kafka ....................... SKIPPED
[INFO] Spark Project Examples ............................. SKIPPED
[INFO] Spark Project YARN Shuffle Service ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.048 s
[INFO] Finished at: 2015-02-09T10:17:47+08:00
[INFO] Final Memory: 49M/331M
[INFO] ------------------------------------------------------------------------
[**ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.0:compi
le (scala-compile-first) on project spark-network-common_2.10: wrap: java.io.IOE
xception: Cannot run program "javac": CreateProcess error=2, The system cannot f
ind the file specified -> [Help 1]**
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :spark-network-common_2.10
I had first installed JRE instead of JDK. My environment variables still referenced the JRE folder, and so it couldn't find the javac.exe binary.
A 'quirk' with Spark builds is that it can download its own version of Maven if it determines it is required.
When you run ./build/mvn clean package you are not running Maven directly, you are running a Spark proprietary script. The first thing that script does is check if your mvn --version is new enough for the version that the project determines it needs (which is set in the pom.xml file).
This is an important point because if you're running an old version of maven, Spark may download an additional maven version and install it and use that instead.
Some key things:
When you run ./build/mvn clean package, check which version of maven it is using
When maven runs it does its own traversal to figure out which JAVA_HOME is used
Before trying to run the spark build, check JAVA_HOME is set as a variable
Check that the JAVA_HOME version is a full jdk, not just a jre
Update your Maven to the latest version (or check it is at least as new as the version set by in the pom.xml in the root directory
Thanks
For this problem you need to set your java environment path correctly in .bashrc file. Then you need to build maven correct on set maven path for that check mvn -version.
Then it will build automaticaly without error.

Resources