exec-maven-plugin does not run on jenkins - maven

Could anyone help me with this,
My jasmine javascript unit tests run successfully when i build my app in eclipse:
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # sig ---
[INFO] Installing C:\Users\C5168279\git\smsigcom.sap.solman.graphical.component.sig\SMSIG\target\sig.war to C:\Users\C5168279\.m2\repository\com\sap\solman\graphical\component\sig\1.0.0\sig-1.0.0.war
[INFO] Installing C:\Users\C5168279\git\smsigcom.sap.solman.graphical.component.sig\SMSIG\pom.xml to C:\Users\C5168279\.m2\repository\com\sap\solman\graphical\component\sig\1.0.0\sig-1.0.0.pom
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) # sig ---
2014-02-20 17:35:35 Device API logging initialized - DEVICE
2014-02-20 17:35:35 registerResourcePath ('', 'https://sapui5.hana.ondemand.com/resources/') - sap.ui.ModuleSystem
2014-02-20 17:35:35 URL prefixes set to: - sap.ui.ModuleSystem
2014-02-20 17:35:35 (default) : https://sapui5.hana.ondemand.com/resources/ - sap.ui.ModuleSystem
XMLHttpRequest cannot load https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library-preload.json. Origin file:// is not allowed by Access-Control-Allow-Origin.
2014-02-20 17:35:37 failed to preload 'sap.ui.controller.library-preload': Error: NETWORK_ERR: XMLHttpRequest Exception 101 - sap.ui.ModuleSystem
XMLHttpRequest cannot load https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library.js. Origin file:// is not allowed by Access-Control-Allow-Origin.
Error: failed to load 'sap/ui/controller/library.js' from https://sapui5.hana.ondemand.com/resources/sap/ui/controller/library.js: 0 - Error: NETWORK_ERR: XMLHttpRequest Exception 101
file:///C:/Users/C5168279/git/smsigcom.sap.solman.graphical.component.sig/SMSIG/src/test/js_unit/AppCoreController.Test.js:1
Runner Started.
MainController : should check if all parameters are empty , ags_sig_app.Views.Main : Graph.checkParameters() ...
Failed.
MainController : should check that the GraphID exist for Display Mode, ags_sig_app.Views.Main : Graph.checkParameters() ...
Failed.
MainController : should check that the Context Parameters exist for SMUD Graph Providers, ags_sig_app.Views.Main : Graph.checkParameters() ...
Failed.
MainController : should check that the GraphMode exist, ags_sig_app.Views.Main : Graph.checkParameters() ...
Failed.
MainController : should check that Display scenario is ok, ags_sig_app.Views.Main : Graph.checkParameters() ...
Failed.
BUT, when i deploy my application in Jenkins the test case are not detected by Jenkins
the exec-maven-plugin does not run on jenkins.
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # SMGC ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SMGC ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory d:\.jenkins\jobs\com.sap.solman.graphical.component.sig.git\workspace\gitRepo\SMSIG\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) # SMGC ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # SMGC ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.676s
[INFO] Finished at: Thu Feb 20 17:23:29 CET 2014
[INFO] Final Memory: 13M/491M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS
This is the plugin my pom.xml:
<plugins>
<!-- Run jasmine unit tests with phantomjs ************************* -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>PhantomJS Unit Testing</id>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${basedir}/src/test/phantomjs_framework/phantomjs.exe</executable>
<arguments>
<argument>run_jasmine.js</argument>
<argument>test_runner.html</argument>
<!-- <argument>${project.build.directory}/surefire-reports</argument> -->
</arguments>
<workingDirectory>${basedir}/src/test/phantomjs_framework</workingDirectory>
</configuration>
</plugin>
Any ideas?
Kais.

Related

Maven `pre` and `post` phases

Are the pre and post phases always executed when I execute the associated phase? For example, if I do mvn clean, will this execute the mvn post-clean phase, too?
I was looking at https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference, in which it said:
The following lists all build phases of the default, clean and site
lifecycles, which are executed in the order given up to the point of
the one specified.
So strictly speaking, since post-clean comes after clean, it should not be executed if I just do mvn clean. But my gut feel is different - although, I didn't find a way to verify this, as the maven stdout doesn't print the phase it's executing.
Could anyone weigh in on the answer and how you verified?
You can bind a plugin (such as echo-maven-plugin) to the phases of the clean lifecycle to help verify if/when each phase is executed.
For example, given the following plugin definition:
<plugin>
<groupId>com.github.ekryd.echo-maven-plugin</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<id>pre-clean</id>
<phase>pre-clean</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<message>In 'pre-clean'</message>
</configuration>
</execution>
<execution>
<id>clean</id>
<phase>clean</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<message>In 'clean'</message>
</configuration>
</execution>
<execution>
<id>post-clean</id>
<phase>post-clean</phase>
<goals>
<goal>echo</goal>
</goals>
<configuration>
<message>In 'post-clean'</message>
</configuration>
</execution>
</executions>
</plugin>
Invoking mvn clean will result in the following output:
$ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (pre-clean) # sandbox ---
[INFO] In 'pre-clean'
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # sandbox ---
[INFO] Deleting target
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (clean) # sandbox ---
[INFO] In 'clean'
So, there's no invocation of the post-clean phase there.
Invoking mvn clean compile will result in the following output:
$ mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (pre-clean) # sandbox ---
[INFO] In 'pre-clean'
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # sandbox ---
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (clean) # sandbox ---
[INFO] In 'clean'
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # sandbox ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # sandbox ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to ...
Again, there's no invocation of the post-clean phase there. This implies that the maven-clean-plugin (and perhaps nothing else) is not bound to post-clean.
Invoking mvn post-clean will result in the post-clean phase being invoked ...
$ mvn post-clean
[INFO] Scanning for projects...
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (pre-clean) # sandbox ---
[INFO] In 'pre-clean'
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # sandbox ---
[INFO] Deleting target
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (clean) # sandbox ---
[INFO] In 'clean'
[INFO]
[INFO] --- echo-maven-plugin:1.2.0:echo (post-clean) # sandbox ---
[INFO] In 'post-clean'
So, based on the above test I think the following statements are true:
post-clean is not invoked when you call clean
post-clean is only called when you explicitly invoke post-clean (note: invoking the pre- and post- phases directly is unusual)

Jaxb2 maven plugin : Sources vs SchemaDirectory

I am making a maven project that will make use of Jaxb2-maven-plugin to generate java files out of xsd files. My Project structure is like:
project.basedir
--src/main/resources/schemas
----common
----request
----response
Below is the plugin config from pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>xjc-PDF</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<extension>true</extension>
<clearOutputDir>false</clearOutputDir>
<outputDirectory>${project.build.directory}/generated-sources/jaxb</outputDirectory>
<explicitAnnotation>true</explicitAnnotation>
<!-- <schemaDirectory>${project.basedir}/src/main/resources/schemas</schemaDirectory> -->
<sources>
<source>${project.basedir}/src/main/resources/schemas/common</source>
<source>${project.basedir}/src/main/resources/schemas/response</source>
<source>${project.basedir}/src/main/resources/schemas/request</source>
</sources>
<bindingDirectory>${project.basedir}/src/main/resources/schemas</bindingDirectory>
<!-- <bindingDirectory>${project.basedir}/src/main/resources/bindings</bindingDirectory> -->
<bindingFiles>jaxb-bth.xjb</bindingFiles>
</configuration>
</execution>
</executions>
</plugin>
If I compile like this then I get below error (even though the source directories contains valid schema files):
C:\ESB_SOAP5_Space\pdf-util>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pdf-util 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # pdf-util ---
[INFO] Deleting C:\ESB_SOAP5_Space\pdf-util\target
[INFO]
[INFO] --- build-helper-maven-plugin:1.6:add-source (add-source) # pdf-util ---
[INFO] Source directory: C:\ESB_SOAP5_Space\pdf-util\target\generated-sources\jaxb added.
[INFO]
[INFO] --- jaxb2-maven-plugin:1.6:xjc (xjc-PDF) # pdf-util ---
[INFO] Generating source...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.205 s
[INFO] Finished at: 2018-03-19T06:27:02+11:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc (xjc-PDF) on project pdf-util: No schemas have been found -> [Help 1]
However, if I comment sources and uncomment and modify like below, then I am able to generate java classes out of schemas under common.
<schemaDirectory>${project.basedir}/src/main/resources/schemas/common</schemaDirectory>
Can anyone tell me why is this behaving like this? Also what do I do if I have to parse all the schema files under one root folder ( which has multiple child folders)?
Thanks
Version 1.6 of the plugin does not support "sources" tag. You can use "sources tag on version 2.4 or newer.
If you have multiple directories containing xsds, use multiple executions in your configuration with each schemaDirectory pointing to one of your directories.

Maven don't execute junit test

I'm trying to test this project: https://github.com/deglans/jenktest
but maven say that:
$ mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jenktest
[INFO] hello
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jenktest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # jenktest ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # jenktest ---
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/pom.xml to /home/deglans/.m2/repository/io/github/deglans/jenktest/0.0.1-SNAPSHOT/jenktest-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hello 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hello ---
[INFO] Deleting /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /documenti/deglans/Programs/IdeaProjects/jenktest/hello/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # hello ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # hello ---
[INFO] Building jar: /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/hello-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # hello ---
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/hello/target/hello-0.0.1-SNAPSHOT.jar to /home/deglans/.m2/repository/io/github/deglans/hello/0.0.1-SNAPSHOT/hello-0.0.1-SNAPSHOT.jar
[INFO] Installing /documenti/deglans/Programs/IdeaProjects/jenktest/hello/pom.xml to /home/deglans/.m2/repository/io/github/deglans/hello/0.0.1-SNAPSHOT/hello-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] jenktest ........................................... SUCCESS [ 0.449 s]
[INFO] hello .............................................. SUCCESS [ 1.715 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.360 s
[INFO] Finished at: 2017-12-16T11:41:59+01:00
[INFO] Final Memory: 14M/48M
[INFO] ------------------------------------------------------------------------
What is the warning and why maven completely skip the test phase?
The final purpose of this work is to test email jenkins feature, but for now I'm blocked by this problem...
Thanks
Summary
You need to either rename GreetingTests.java to GreetingTest.java, or update your maven-surefire-plugin. Updating surefire plugin can provide better pattern for inclusions of tests. You can declare it in project's parent POM ./pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- ... -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Detail
What is the warning and why maven completely skip the test phase?
Maven didn't skip the test phase. Maven unit tests are executed by maven-surefire-plugin, and it has been triggered correctly:
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # hello ---
You need to rename your test to GreetingTests.java to GreetingTest.java. Because the surefire-plugin:2.12.4 does not recognize pattern *Tests.java, as documented here:
By default, the plugin will automatically include all test classes with the following wildcard patterns:
"**/Test*.java" - includes all of its subdirectories and all java
filenames that start with "Test".
"**/*Test.java" - includes all of its subdirectories and all java
filenames that end with "Test".
"**/*TestCase.java" - includes all of its subdirectories and all java
filenames that end with "TestCase".

Why are my resources not getting copied in the "validate" phase?

I am trying to make sure that the correct resources are moved to WEB-INF/config/ no matter if I call
mvn gcloud:deploy
or
mvn tomcat7:run
which is why I am enforcing -Dpackage-mode=<value> to be set. I am using the maven-resource-plugin for the copy part like this:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>src/main/webapp/WEB-INF/config</outputDirectory>
<resources>
<resource>
<directory>src/main/assembly/${package-mode}/config</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
However, if I run
mvn validate tomcat7:run -Dpackage-mode=dev
for starting the server the files are not getting copied.
E:\java\mz\mz-server\mz-web-server>mvn validate tomcat7:run -Denv=dev -Dpackage-mode=dev
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mz-web-server 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) # mz-web-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-property) # mz-web-server ---
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes # mz-web-server >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) # mz-web-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-property) # mz-web-server ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # mz-web-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # mz-web-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes # mz-web-server <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) # mz-web-server ---
[INFO] Running war on http://localhost:8080/
[INFO] Using existing Tomcat server configuration at E:\java\mz\mz-server\mz-web-server\target\tomcat
[INFO] setting SystemProperties:
[INFO] gwt.codeserver.port=9876
[INFO] create webapp with contextPath:
Jun 03, 2016 5:24:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 03, 2016 5:24:57 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jun 03, 2016 5:24:57 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
...
What am I doing wrong here? I actually don't know if validate is a good choice here and I am not really bound to a certain phase. All I want is to make sure that the configuration files are getting copied according to package-mode.
But:
If I just run
mvn validate -Dpackage-mode=dev
then everything is working as expected - the files are getting copied.
You shouldn't use the maven-resources-plugin to copy webapp resources, this plugin is only for application resources. Furthermore, you should never generate or copy files under src, like what you're doing with <outputDirectory>src/main/webapp/WEB-INF/config</outputDirectory>. Generated files should always be placed under the target folder.
Instead, use the maven-war-plugin. You can configure it to filter a specific directory and output it in the WAR like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webResources>
<resource>
<directory>src/main/assembly/${package-mode}/config</directory>
<filtering>true</filtering>
<targetPath>WEB-INF/config</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
This will filter the directory src/main/assembly/${package-mode}/config and place the files under it in the target folder WEB-INF/config in the WAR.
With this change, you will be able to run your webapp with mvn clean tomcat7:run-war (and not tomcat7:run since that wouldn't package the WAR).

Maven Findbugs not producing reports in site lifecycle

I'm trying to create the Findbugs HTML report for the site reports. I finally got Findbugs to actually run (before it would skip) because I had to include the goal findbugs in the <build> phase under the find bugs report. However, the findbugs.html report is not being generated even though I have findbugs defined in my <reporting> section.
Here's my configuration for Findbugs:
<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<xmlOutput>true</xmlOutput>
</configuration>
<executions>
<execution>
<goals>
<goal>findbugs</goal>
</goals>
</execution>
</executions>
</plugin>
....
<plugins>
</build>
....
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<xmlOutput>true</xmlOutput>
<failOnError>false</failOnError>
<xmlOutput>true</xmlOutput>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
<reporting>
My execution looks like this:
$ mvn clean site
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building project 2.0.4
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # crypto ---
[INFO] Deleting target
[INFO]
[INFO] --- maven-site-plugin:3.3:site (default-site) # crypto ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.7
[INFO] configuring report plugin org.codehaus.mojo:findbugs-maven-plugin:2.5.2
[INFO] configuring report plugin org.apache.maven.plugins:maven-pmd-plugin:3.0.1
[INFO] configuring report plugin org.apache.maven.plugins:maven-javadoc-plugin:2.9.1
[INFO]
[INFO] >>> maven-javadoc-plugin:2.9.1:aggregate (report:aggregate) # crypto >>>
[INFO]
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) # crypto ---
Retrieving document at 'src/main/wsdl/Tokenizer.wsdl'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) # crypto ---
[INFO] Source directory: target/generated-sources added.
[INFO]
[INFO] <<< maven-javadoc-plugin:2.9.1:aggregate (report:aggregate) # crypto <<<
[INFO]
[INFO] >>> maven-javadoc-plugin:2.9.1:test-aggregate (report:test-aggregate) # crypto >>>
[INFO]
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) # crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) # crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # crypto ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/david/workspace/KeyManagment-trunk/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # crypto ---
[INFO] Compiling 13 source files to /Users/david/workspace/KeyManagment-trunk/target/classes
[INFO]
[INFO] --- findbugs-maven-plugin:2.5.2:findbugs (default) # crypto ---
[INFO] Fork Value is true
[java] The following classes needed for analysis were missing:
[java] com.ingrian.internal.ilc.IngrianLogger
[java] com.ingrian.security.nae.NAESession
[java] com.ingrian.internal.config.Config
[java] com.ingrian.security.nae.NAEKey
[java] com.ingrian.security.nae.HmacSHA256
[java] com.ingrian.internal.xml.XMLException
[java] com.ingrian.security.nae.NAEAESCipher
[java] com.ingrian.security.nae.IngrianProvider
[java] Warnings generated: 310
[java] Missing classes: 8
[INFO] Done FindBugs Analysis....
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) # crypto ---
[INFO]
[INFO] <<< maven-javadoc-plugin:2.9.1:test-aggregate (report:test-aggregate) # crypto <<<
[INFO]
[INFO] >>> maven-javadoc-plugin:2.9.1:javadoc (report:javadoc) # crypto >>>
[INFO]
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) # crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) # crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO]
[INFO] <<< maven-javadoc-plugin:2.9.1:javadoc (report:javadoc) # crypto <<<
[INFO]
[INFO] >>> maven-javadoc-plugin:2.9.1:test-javadoc (report:test-javadoc) # crypto >>>
[INFO]
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) # crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) # crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # crypto ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/david/workspace/KeyManagment-trunk/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # crypto ---
[INFO] Compiling 2 source files to /Users/david/workspace/KeyManagment-trunk/target/classes
[INFO]
[INFO] --- findbugs-maven-plugin:2.5.2:findbugs (default) # crypto ---
[INFO] Fork Value is true
[java] The following classes needed for analysis were missing:
[java] com.ingrian.internal.ilc.IngrianLogger
[java] com.ingrian.security.nae.NAESession
[java] com.ingrian.internal.config.Config
[java] com.ingrian.security.nae.NAEKey
[java] com.ingrian.security.nae.HmacSHA256
[java] com.ingrian.internal.xml.XMLException
[java] com.ingrian.security.nae.NAEAESCipher
[java] com.ingrian.security.nae.IngrianProvider
[java] Warnings generated: 310
[java] Missing classes: 8
[INFO] Done FindBugs Analysis....
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) # crypto ---
[INFO]
[INFO] <<< maven-javadoc-plugin:2.9.1:test-javadoc (report:test-javadoc) # crypto <<<
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Skipped "JavaDocs" report, file "apidocs/index.html" already exists for the English version.
[INFO] Skipped "Test JavaDocs" report, file "testapidocs/index.html" already exists for the English version.
[INFO] Generating "About" report --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:2.7
...
[INFO] Generating "Project Team" report --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project Summary" report --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.7
[INFO] Generating "CPD Report" report --- maven-pmd-plugin:3.0.1
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "PMD Report" report --- maven-pmd-plugin:3.0.1
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "JavaDocs" report --- maven-javadoc-plugin:2.9.1
[INFO]
Loading source files for package com.ihotelier.crypto...
Loading source files for package com.safenet.tokenization.wsclient...
Constructing Javadoc information...
Standard Doclet version 1.7.0_13
Building tree for all the packages and classes...
Generating ...
4 warnings
[WARNING] Javadoc Warnings
[WARNING] ...
[INFO] Fixed Javadoc frame injection vulnerability (CVE-2013-1571) in 1 files.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:30.831s
[INFO] Finished at: Tue Nov 05 14:02:04 EST 2013
[INFO] Final Memory: 40M/115M
[INFO] ------------------------------------------------------------------------
I see findbugs being configured in the beginning of my execution under the maven-site-plugin. I see Findbugs executing (twice!) after maven-compiler-plugin runs. (I may change the goal to process-classes to prevent this double execution. I see 8 errors, but we don't really use those classes. (I need to figure out how to skip over these classes).
Near the end of the build, I see the PMD and CPD Reports being generated (Generating "CPD Report" report), but not Findbugs.
When I look at the build results, I see target/findbugs.xml and target/findbugsXML.xml, but nothing under target/site.
Sorry for the excessive output. I want to make sure I wasn't skipping anything important.
Shows you what I know about Maven. Two things I discovered:
Running site does not execute package (although compile does run -- probably because it's needed for some of the reports).
Findbugs cannot produce a site report unless the package is done first.
I moved findbugs plugin to run in the package phase, so it doesn't run twice, and everything now seems fine.
I think it's similar to the surefire reports issues, so try adding the site plugin to the <pluginManagement> section:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</pluginManagement>

Resources