jenkins maven build not running JUnit tests - java

I have the exact same code, just being compiled in two different ways. One is a maven build in Spring, and the other is a maven build in Jenkins.
The Spring build produces
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestApplication 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Woof ---
[INFO] Deleting TestApplication\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # Woof ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 7 source files to TestApplication\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # Woof ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # Woof ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to TestApplication\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Woof ---
[INFO] Surefire report directory: TestApplication\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.woof.bark.TestTest
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.667 sec <<< FAILURE!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
But the Jenkins build produces
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestApplication 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Woof ---
[INFO] Deleting TestApplication\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # Woof ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 7 source files to TestApplication\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # Woof ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Woof ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # Woof ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to TestApplication\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Woof ---
[INFO] Surefire report directory: TestApplication\target\surefire-reports
[JENKINS] Recording test results
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
Finished: SUCCESS
How do i get Jenkins to also run unit tests and stop build when a case fails?
Adding MAVEN_OPTS -DskipTests=false -Dmaven.test.failure.ignore=false does not work.

Turns out i was missing a plugin in my POM.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
</plugin>

Related

Spring boot application deployed on heroky returns empty response (no headers, no data)

I have created a simple Spring boot app and deployed to Heroku. It builds and runs normally, and no errors are displayed in the logs, but when i try to access the application on insomnia, it gives me the following error description: Error: Server returned nothing (no headers, no data).
The application works perfectly when running on localhost.
Here is my Procfile:
web: java -Dserver.port=$PORT -Dspring.profiles.active=prod $JAVA_OPTS -jar target/seniorerp-0.0.1-SNAPSHOT.jar
Heroku build log:
-----> Using buildpack: heroku/java
-----> Java app detected
-----> Installing OpenJDK 11... done
-----> Executing Maven
$ ./mvnw -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< thiago.piffer:seniorerp >-----------------------
[INFO] Building seniorerp 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) # seniorerp ---
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:list (default-cli) # seniorerp ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # seniorerp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) # seniorerp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 25 source files to /tmp/build_321f1d66/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # seniorerp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build_321f1d66/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) # seniorerp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /tmp/build_321f1d66/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # seniorerp ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) # seniorerp ---
[INFO] Building jar: /tmp/build_321f1d66/target/seniorerp-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.7.2:repackage (repackage) # seniorerp ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # seniorerp ---
[INFO] Installing /tmp/build_321f1d66/target/seniorerp-0.0.1-SNAPSHOT.jar to /tmp/codon/tmp/cache/.m2/repository/thiago/piffer/seniorerp/0.0.1-SNAPSHOT/seniorerp-0.0.1-SNAPSHOT.jar
[INFO] Installing /tmp/build_321f1d66/pom.xml to /tmp/codon/tmp/cache/.m2/repository/thiago/piffer/seniorerp/0.0.1-SNAPSHOT/seniorerp-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.955 s
[INFO] Finished at: 2022-08-24T14:10:10Z
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 96.8M
-----> Launching...
Released v20
https://senior-erp-desafio-tecnico.herokuapp.com/ deployed to Heroku

Jenkins is unable to find the java file in workspace

We are following the instructions given by some tutorials to integrate our project with jenkins unsuccessfully, we think the reason is the path to the scripts of java. Could you give us a hand? The log result is:
Started by user admin
Running as SYSTEM Building in workspace C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo Parsing POMs Established TCP socket on 57342 [JenkinsDemo] $ "C:\Program Files\Java\jdk-11.0.11/bin/java" -cp C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Users\xxxxxxx\apache-maven-3.8.1\boot\plexus-classworlds-2.6.0.jar;C:\Users\xxxxxxx\apache-maven-3.8.1/conf/logging jenkins.maven3.agent.Maven35Main C:\Users\xxxxxxx\apache-maven-3.8.1 C:\Users\xxxxxxx\.jenkins\war\WEB-INF\lib\remoting-4.12.jar C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar 57342 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml install [INFO] Scanning for projects... [INFO] [INFO]
----------------------< JenkinsDemo:JenkinsDemo >----------------------- [INFO] Building JenkinsDemo 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) # JenkinsDemo
--- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # JenkinsDemo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # JenkinsDemo --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # JenkinsDemo --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # JenkinsDemo --- [INFO] No tests to run. [JENKINS] Guardando informes de test [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) # JenkinsDemo --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) # JenkinsDemo --- [INFO] Installing C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\target\JenkinsDemo-0.0.1-SNAPSHOT.jar to C:\Users\xxxxxxx\.m2\repository\JenkinsDemo\JenkinsDemo\0.0.1-SNAPSHOT\JenkinsDemo-0.0.1-SNAPSHOT.jar [INFO] Installing C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml to C:\Users\xxxxxxx\.m2\repository\JenkinsDemo\JenkinsDemo\0.0.1-SNAPSHOT\JenkinsDemo-0.0.1-SNAPSHOT.pom [INFO]
------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------ [INFO] Total time: 3.337 s [INFO] Finished at: 2022-05-09T12:20:50+02:00 [INFO]
------------------------------------------------------------------------ Esperando a que Jenkins finalice de recopilar datos [JENKINS] Archiving C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml to JenkinsDemo/JenkinsDemo/0.0.1-SNAPSHOT/JenkinsDemo-0.0.1-SNAPSHOT.pom [JENKINS] Archiving C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\target\JenkinsDemo-0.0.1-SNAPSHOT.jar to JenkinsDemo/JenkinsDemo/0.0.1-SNAPSHOT/JenkinsDemo-0.0.1-SNAPSHOT.jar channel stopped [JenkinsDemo] $ cmd /c call C:\Users\xxxxxxx\AppData\Local\Temp\jenkins13221465416928573076.bat
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>javac EnviarPruebaDeIngles.java error: file not found: EnviarPruebaDeIngles.java Usage: javac <options> <source files> use
--help for a list of possible options
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>java EnviarPruebaDeIngles Error: Could not find or load main class EnviarPruebaDeIngles Caused by: java.lang.ClassNotFoundException: EnviarPruebaDeIngles
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>exit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE
Project configuration is:
Our eclipse with selenium project tree, our intention is to execute like the main classes which are going to be located at com.jenkins.demo

Testing a single package skips parametrized tests in TestNG

Overall description
I have a simple Maven project with a parameterized TestNG test. The parameter is specified through a suite XML file. When I run tests for the whole project, the suite XML file is read, parameter is used and the parameterized test is executed. However, when I attempt to test a single package only, then the suite XML file is not used apparently and the test is skipped with a complaint such as "Parameter '...' is required by #Test on method ... but has not been marked #Optional or defined". The question is how to run individual tests and test packages with parameters.
For more details see below.
Testing the whole project
This works as expected. Two test methods are executed. One test method is parameterless, other is parameterized and the parameter value is taken from the suite XML file. This is a equivalent of Run\Test project in NetBeans.
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
testGetChangedString
getTrue
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.844 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.702s
[INFO] Finished at: Wed Jun 06 23:42:20 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>
Testing a single package
In this case only one test method runs, the parameterless one. The parameterized test method is skipped. This is a equivalent of right-clicking a package in NetBeans and selecting "Test package".
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test -Dtest=com.endersoft.testngdemo.**.*
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.endersoft.testngdemo.SimpleClassNGTest
getTrue
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 2.422 s - in com.endersoft.testngdemo.SimpleClassNGTest
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.268s
[INFO] Finished at: Wed Jun 06 23:47:28 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
Project source
The zipped project source can be downloaded from here (very small)
You need separate XML files for separate package. When running TestNG with package as parameter, TestNG is not automatically aware about the XML file, like it doesn't exist.
So you have multiple options, specify the parameters in properties file, or hardcode them, or create separate XML files for every package that you can then pass as parameter.

mvn tomcat7:deploy takes too long to deploy?

I am using tomcat7-maven-plugin to deploy my spring batch admin application,
below is my configuration in pom,
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- Tomcat 7 has a different manager path - text - than other versions -->
<url>http://localhost:8081/manager/text</url>
<username>myusername</username>
<password>mypassword</password>
<path>/${project.build.finalName}</path>
<update>true</update>
</configuration>
</plugin>
I am running,
mvn clean install tomcat7:deploy
Though it completes successfully, it takes too long to complete this command nearly (4-5 min).
Below is the output of command. It takes lot of time to receive response after uploading war file. You can observer below output, it took 4.16 min.
It worked pretty fast till it displays the message "uploaded .." but after that it keeps waiting for response for 4-5 min.
I need to deploy application on multiple servers (5 servers) so it will take 25 min which is too long for only deployment.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.st:batch:war:1.0.0-BUILD-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.batch:spring-batch-core:jar -> version ${spring.batch.version} vs (?) # line 125, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.batch:spring-batch-infrastructure:jar -> version ${spring.batch.version} vs (?) # line 129, column 15
[WARNING] 'build.plugins.plugin.version' for org.mortbay.jetty:maven-jetty-plugin is missing. # line 182, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. # line 189, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # org.springframework.batch:spring-batch-admin-parent:1.3.0.RC1, /home/ubuntu/.m2/repository/org/springframework/batch/spring-batch-admin-parent/1.3.0.RC1/spring-batch-admin-parent-1.3.0.RC1.pom, line 245, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. # org.springframework.batch:spring-batch-admin-parent:1.3.0.RC1, /home/ubuntu/.m2/repository/org/springframework/batch/spring-batch-admin-parent/1.3.0.RC1/spring-batch-admin-parent-1.3.0.RC1.pom, line 253, column 12
[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] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building st 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # batch ---
[INFO] Deleting /home/ubuntu/java/spring/batch/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 105 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # batch ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 53 source files to /home/ubuntu/java/spring/batch/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/spring/batch/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # batch ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # batch ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # batch ---
[INFO] Packaging webapp
[INFO] Assembling webapp [batch] in [/home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ubuntu/java/spring/batch/src/main/webapp]
[INFO] Webapp assembled in [130 msecs]
[INFO] Building war: /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # batch ---
[INFO] Installing /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war to /home/ubuntu/.m2/repository/com/st/batch/1.0.0-BUILD-SNAPSHOT/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] Installing /home/ubuntu/java/spring/batch/pom.xml to /home/ubuntu/.m2/repository/com/st/batch/1.0.0-BUILD-SNAPSHOT/batch-1.0.0-BUILD-SNAPSHOT.pom
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) # batch >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 105 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # batch ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # batch ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/spring/batch/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # batch ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # batch ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # batch ---
[INFO] Packaging webapp
[INFO] Assembling webapp [batch] in [/home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ubuntu/java/spring/batch/src/main/webapp]
[INFO] Webapp assembled in [73 msecs]
[INFO] Building war: /home/ubuntu/java/spring/batch/target/batch-1.0.0-BUILD-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) # batch <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) # batch ---
[INFO] Deploying war to http://localhost:8081/batch-1.0.0-BUILD-SNAPSHOT
Uploading: http://localhost:8081/manager/text/deploy?path=%2Fbatch-1.0.0-BUILD-SNAPSHOT&update=true
Uploaded: http://localhost:8081/manager/text/deploy?path=%2Fbatch-1.0.0-BUILD-SNAPSHOT&update=true (16362 KB at 116869.5 KB/sec)
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] OK - Deployed application at context path /batch-1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:16 min
[INFO] Finished at: 2014-07-23T11:49:33+00:00
[INFO] Final Memory: 23M/303M
[INFO] -------------------------
You could use the following commands to deploy your app. It will help with the length of time it takes to redelpoy, but it will not stop the length of time it takes for the Uploading: & Uploaded: parts since its waiting for Tomcat.
mvn -T 1C install tomcat7:redeploy-only -DskipTests -offline
-T 1C: This means that we will use 1 thread per core on the deploying machine

Apache Tomcat 7 HTTP Connector node not found in intelliJ

I am developing an application using GWT, Maven on Apache Tomcat 7 with intelliJ idea. i have recently debugged and run my application but faced the following problem:Error running Tomcat 7: HTTP Connector node not found: set up one in the server.xml.
Apache Tomcat run code:
"c:\program files (x86)\jetbrains\intellij idea 11.1.4\jre\jre\bin\java" -Dclassworlds.conf=C:\Tools\apache-maven-3.1.1\bin\m2.conf -Dmaven.home=C:\Tools\apache-maven-3.1.1 -Dfile.encoding=UTF-8 -classpath C:\Tools\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar org.codehaus.classworlds.Launcher --offline --no-plugin-registry --fail-fast --strict-checksums --update-snapshots -f D:\Projects\ebank\pom.xml package -P gwtDebug,oracle
[WARNING] Command line option -npr is deprecated and will be removed in future Maven versions.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse GWT Application 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.1.13 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- native2ascii-maven-plugin:1.0-beta-1:native2ascii (native2ascii-utf8) # AppfuseGWT ---
[INFO] Includes: [ApplicationResources_zh*.properties, ApplicationResources_ko*.properties, displaytag_zh*.properties]
[INFO] Excludes: []
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (default) # AppfuseGWT ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 17 resources
[INFO] Copying 9 resources
[INFO]
[INFO] >>> hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] <<< hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT <<<
[INFO]
[INFO] --- hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT ---
[INFO] skipping hibernate3 execution
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test-compile) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # AppfuseGWT ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- gwt-maven-plugin:2.5.0:compile (gwtcompile) # AppfuseGWT ---
[INFO] uz.eopc.webapp.MainModuleDebug is up to date. GWT compilation skipped
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) # AppfuseGWT ---
[INFO] Packaging webapp
[INFO] Assembling webapp [AppfuseGWT] in [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\Projects\ebank\src/main/resources/packaged] to [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Copying webapp resources [D:\Projects\ebank\src\main\webapp]
[INFO] Webapp assembled in [279 msecs]
[INFO] Building war: D:\Projects\ebank\target\AppfuseGWT-1.0.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.405s
[INFO] Finished at: Mon Dec 09 10:54:04 UZT 2013
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution finished
What should be done to fix this problem?
I have found the answer to fix this problem. I was using ubuntu 12.04 and in linux systems everything is connected with permissions. After i have opened read and write permission to my tomcat directory, it has worked out. to open read and write permission to a directory in ubuntu just write:
$ sudo chmod 777 -R folder_name/

Categories