SOAP UI Maven Integration - maven

My Soap UI project and pom.xml resides under D:\Projekte\JacobMarshell
wanted to execute the testsuite of the soap ui project using maven.
Test suite is not executed when i use the following command
"mvn test" and getting the following response.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 2 soapUI Sample
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: D:\Projekte\JacobMarshell
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Here is the code snippet of 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">
<modelVersion>4.0.0</modelVersion>
<groupId>src.main.resources</groupId>
<artifactId>soapui-maven2-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 soapUI Sample</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>eviwarePluginRepository</id>
<url>http://www.soapui.org/repository/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.5.1</version>
<configuration>
<projectFile>Sample-Upload-to-Upload-Diagnose---Complete--soapui-project.xml</projectFile>
<junitReport>true</junitReport>
<outputFolder>reports</outputFolder>
<testSuite>diag_upload_tc</testSuite>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Not able to figureout why maven does not execute my testsuite?

The actual problem was with the repository... I removed the eviware folder in the repository and start to run the "mvn test" command, where the repository got downloaded and then Test suite started to get execute thanks Marcel Stör for give me the hope that I would get an answer from some day.

Use below plugin:
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<!– Change the name to identify –>
<configuration>
<projectFile>src/test/resources/soapui/Soapui-auto-soapui-project.xml</projectFile>
<!– Change the project file name –>
<outputFolder>target/surefire-reports</outputFolder>
<!– Change the suite name –>
<junitReport>true</junitReport>
<exportwAll>true</exportwAll>
<printReport>true</printReport>
<testFailIgnore>false</testFailIgnore>
<projectProperties>
<value>EnvName=${soapUiEnv}</value>
<value>ServiceEndPoint=${ServiceEndPoint}</value>
<value>TestReportPath=${project.build.directory}/surefire-reports/</value>
</projectProperties>
<soapuiProperties>
<property>
<name>soapui.properties</name>
<value>src/test/resources/soapui/soapui-auto_data.properties</value>
</property>
</soapuiProperties>
</configuration>
</plugin>
You need to create a test suite and copy it to "src/test/resources/soapui/".
Specify the path in project file tag and to execute the tests to running application run command "mvn com.smartbear.soapui:soapui-maven-plugin:5.0.0:test -DServiceEndPoint=http://localhost:8080"
You can refer below blog post, explained with example soap automation using maven plugin for spring boot application.

Related

maven-dependency-plugin usage to download dependency jars

Hoping someone can explain how to set the plugin options correctly.
I am looking to have a pom file that someone could execute an mvn command on to download all the jars of the dependencies (transitive included) defined in the pom (including their sources and javadoc jars) from Maven Central and copy them to a specified directory.
My question appears quite similar to maven-dependency-plugin ignores outputDirectory configuration but dwells on a slightly different aspect. Tried the approach advised in the accepted answer there but that didn't work.
pom file:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>gq.jetstream</groupId>
<artifactId>maven-download-sources-javadocs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<org.springframework.version>5.2.22.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
<build>
<!-- <sourceDirectory>src</sourceDirectory> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<classifier>sources</classifier>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
<includeClassifiers>sources,javadoc</includeClassifiers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Executing mvn package against this pom doesn't do anything. The output for the goal execution was empty.
Alt 1: Tried the following command. This copied the javadoc jars only and not the binary jars and sources jars of the dependencies.
mvn dependency:copy-dependencies#copy-dependencies
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< gq.jetstream:maven-download-sources-javadocs >------------
[INFO] Building maven-download-sources-javadocs 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:copy-dependencies (copy-dependencies) # maven-download-sources-javadocs ---
[INFO] Copying spring-core-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-core-5.2.22.RELEASE-javadoc.jar
[INFO] Copying spring-jcl-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-jcl-5.2.22.RELEASE-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.846 s
[INFO] Finished at: 2022-06-22T02:09:55+01:00
[INFO] ------------------------------------------------------------------------

Maven ignoring plugin version from pluginManagement in profile of submodule

I'm defining plugin versions in the <pluginManagement> section of a parent POM and want to use them in the <plugins> section of submodules.
This is working, unless the plugin is being used inside a profile of a submodule. In this case, the version from the parent POM's <pluginManagement> section is ignored.
Output of mvn -v:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
./pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<modules>
<module>project1</module>
</modules>
<groupId>org.example.test</groupId>
<artifactId>test-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
./project1/pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<parent>
<groupId>org.example.test</groupId>
<artifactId>test-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>project1</artifactId>
<profiles>
<profile>
<id>p1</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Output of mvn versions:display-plugin-updates:
$ mvn versions:display-plugin-updates
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] test-parent
[INFO] project1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-parent 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:display-plugin-updates (default-cli) # test-parent ---
[INFO]
[INFO] All plugins with a version specified are using the latest versions.
[INFO]
[INFO] Project defines minimum Maven version as: 3.1.0
[INFO] Plugins require minimum Maven version of: 3.1.0
[INFO] Note: the super-pom from Maven 3.3.9 defines some of the plugin
[INFO] versions and may be influencing the plugins required minimum Maven
[INFO] version.
[INFO]
[INFO] No plugins require a newer version of Maven than specified by the pom.
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building project1 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.2:display-plugin-updates (default-cli) # project1 ---
[INFO]
[INFO] All plugins with a version specified are using the latest versions.
[INFO]
[WARNING] The following plugins do not have their version specified:
[WARNING] com.github.eirslett:frontend-maven-plugin ................. 0.0.26
[INFO]
[INFO] Project defines minimum Maven version as: 3.1.0
[INFO] Plugins require minimum Maven version of: 3.1.0
[INFO] Note: the super-pom from Maven 3.3.9 defines some of the plugin
[INFO] versions and may be influencing the plugins required minimum Maven
[INFO] version.
[INFO]
[INFO] No plugins require a newer version of Maven than specified by the pom.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] test-parent ........................................ SUCCESS [ 0.851 s]
[INFO] project1 ........................................... SUCCESS [ 0.314 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.649 s
[INFO] Finished at: 2016-09-16T16:03:04+02:00
[INFO] Final Memory: 13M/247M
[INFO] ------------------------------------------------------------------------
I can duplicate the information from the <pluginManagement> section of the parent POM inside the submodules to make it work, but I want to avoid this for obvious reasons.
Maven is not ignoring it, you can check it by executing the following:
mvn -pl project1 help:effective-pom -Doutput=noProfilePom.xml
The effective-pom goal will:
Displays the effective POM as an XML for this build, with the active profiles factored in.
Checking the noProfilePom.xml generated, you will see what effectively Maven will run when building the pom.xml of the project1 module.
There we can see:
<pluginManagement>
<plugins>
...
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
...
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
Hence, the pluginManagement has been merged properly (taken from the parent), while the plugins section doesn't provide it.
But running the following:
mvn -pl project1 -Pp1 help:effective-pom -Doutput=withProfilePom.xml
Note: we are also activating the profile via -Pp1 as part of the goal execution.
As part of the generated withProfilePom.xml will have:
<pluginManagement>
<plugins>
...
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
This time the p1 profile was active and its has properly injected into the plugins section its plugin declaration, taking then its version from the pluginManagement of the parent.
Hence: the pluginManagement section is not ignored by plugins declared in a profile.

Why is PMD OK from command line, but does not work from within Maven?

After many years of successful use of PMD with Ant, I am now trying without success to get PMD to work from within Maven.
To illustrate my problem, I have created a simple Maven system (based upon the Maven tutorial "my-app" hello world program). It differs only in the inclusion of a line of code which should trigger a PMD error using the basic ruleset:
Boolean bar = new Boolean("true");
When I run PMD from the command line, the problem in the code is revealed:
run.sh pmd -d src/main/java -f text -R rulesets/java/basic.xml -language java
maven-pmd-example/src/main/java/com/mycompany/app/App.java:11 Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
However, when I run pmd from within Maven, the problem in the code is not revealed:
-> mvn pmd:check
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-pmd-plugin:2.7.1:check (default-cli) # my-app >>>
[INFO]
[INFO] --- maven-pmd-plugin:2.7.1:pmd (pmd) # my-app ---
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO]
[INFO] <<< maven-pmd-plugin:2.7.1:check (default-cli) # my-app <<<
[INFO]
[INFO] --- maven-pmd-plugin:2.7.1:check (default-cli) # my-app ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.375s
[INFO] Finished at: Sun Feb 03 15:38:02 HST 2013
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
Here is the 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.7.1</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<minimumPriority>0</minimumPriority>
<rulesets>
<ruleset>rulesets/basic.xml</ruleset>
</rulesets>
<targetJdk>1.6</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</build>
</project>
I have uploaded this example system to GitHub so you can see the entire example system (and download/play with it if you would like):
https://github.com/philipmjohnson/maven-pmd-example
It's because you have set the minimumPriority to 0, which will effectively prevent PMD from evaluating any rules at all (refer to this SO question for a discussion on priority).
Please refer to this section of the goal documentation for the PMD plugin for more information.
I'd suggest modifying the configuration to set the minimumPriority to 2 so that you can fail the build for BooleanInstantiation.
Hope this helps!

Maven Error from Eclipse

I had a maven project that worked fine in Eclipse 3.4.2 before I updated that project.
OS: Windows XP, SP2
Maven: maven-2.2.1
Java: jdk1.6.0_17
Eclipse: 3.4.2
m2e: 0.9.8
When I perform the following from Eclipse:
(1) maven clean, then
(2) maven install;
the installation fails. Here is a partial of the log.
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\app\target\tsi-apex-reconciler-app-1.0.18.jar to C:\Documents and Settings\DLiao\.m2\repository\net\transolutions\apex\tsi-apex-reconciler-app\1.0.18\tsi-apex-reconciler-app-1.0.18.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Transolutions Apex Reconciler Web Application
[INFO]
[INFO] Id: net.transolutions.apex:tsi-apex-reconciler-web:war:1.0.18
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[tsi-apex-reconciler-web] in [C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconciler-web-1.0.18]
[INFO] Processing war project
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Transolutions Apex Reconciler ......................... SUCCESS [0.672s]
[INFO] Transolutions Apex Reconciler Data Layer .............. SUCCESS [1.672s]
[INFO] Transolutions Apex Reconciler Render Service Client ... SUCCESS [0.188s]
[INFO] Transolutions Apex Reconciler Application Layer ....... SUCCESS [1.250s]
[INFO] Transolutions Apex Reconciler Web Application ......... FAILED [1.718s]
[INFO] ------------------------------------------------------------------------
[ERROR]
*The following mojo encountered an error while executing:
Group-Id: org.apache.maven.plugins
Artifact-Id: maven-war-plugin
Version: 2.1-alpha-1
Mojo: war
brought in via: packaging: war
While building project:
Group-Id: net.transolutions.apex
Artifact-Id: tsi-apex-reconciler-web
Version: 1.0.18
From file: C:\DLiao\Archive_Reconciler\R18\web\pom.xml
Reason: Failed to copy file for artifact[active project artifact:
artifact = net.transolutions.apex:tsi-apex-reconciler-app:jar:1.0.18:compile;
project: MavenProject: net.transolutions.apex:tsi-apex-reconciler-app:1.0.18 # C:\DLiao\Archive_Reconciler\
R18\app\pom.xml]*
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run with the -e flag
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILED
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Wed Jan 02 14:14:19 CST 2013
[INFO] Final Memory: 3M/20M
[INFO] ------------------------------------------------------------------------
However, if I run
mvn clean install
from DOS command line (Java JDK 1.6.0_17), everything is fine, and the .war fine is deployed under my ~/m2/...
Here is the log file from command line.
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\app\target\tsi-apex-reconciler
-app-1.0.18.jar to C:\Documents and Settings\DLiao\.m2\repository\net\transoluti
ons\apex\tsi-apex-reconciler-app\1.0.18\tsi-apex-reconciler-app-1.0.18.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Transolutions Apex Reconciler Web Application
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\DLiao\Archive_Reconciler\R18\web\target
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\DLiao\Archive_Reconciler\R18\web\s
rc\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp[tsi-apex-reconciler-web] in [C:\DLiao\Archive_Reconcile
r\R18\web\target\tsi-apex-reconciler-web-1.0.18]
[INFO] Processing war project
[INFO] Copying webapp resources[C:\DLiao\Archive_Reconciler\R18\web\src\main\web
app]
[INFO] Webapp assembled in[1110 msecs]
[INFO] Building war: C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconci
ler-web-1.0.18.war
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconciler
-web-1.0.18.war to C:\Documents and Settings\DLiao\.m2\repository\net\transoluti
ons\apex\tsi-apex-reconciler-web\1.0.18\tsi-apex-reconciler-web-1.0.18.war
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Transolutions Apex Reconciler ......................... SUCCESS [1.172s]
[INFO] Transolutions Apex Reconciler Data Layer .............. SUCCESS [2.406s]
[INFO] Transolutions Apex Reconciler Render Service Client ... SUCCESS [0.328s]
[INFO] Transolutions Apex Reconciler Application Layer ....... SUCCESS [3.547s]
[INFO] Transolutions Apex Reconciler Web Application ......... SUCCESS [10.282s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Wed Jan 02 11:23:10 CST 2013
[INFO] Final Memory: 49M/254M
[INFO] ------------------------------------------------------------------------
Any suggestions, please advise.
Thanks
Dave
The parent POM file.
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<reconciler.version>1.0.19</reconciler.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler</artifactId>
<version>1.0.19</version>
<packaging>pom</packaging>
<name>Transolutions Apex Reconciler</name>
<description>Update and reimplementation of the classic reconciler web application.</description>
<modules>
<module>data</module>
<module>app</module>
<module>web</module>
<module>render-service</module>
</modules>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Portfolio Snapshot Repository</name>
<url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
</repository>
<repository>
<id>maven.org</id>
<name>Maven 2 Repository</name>
<url>http://repo2.maven.org/maven2/</url>
</repository>
<repository>
<id>jboss-maven2</id>
<name>JBoss Maven 2 Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>java.net</id>
<name>Java.net Maven Repository</name>
<url>https://maven-repository.dev.java.net/nonav/repository/</url>
</repository>
</repositories>
</project>
The POM file for my web project, which generates the error message.
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler</artifactId>
<version>1.0.19</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler-web</artifactId>
<packaging>war</packaging>
<name>Transolutions Apex Reconciler Web Application</name>
<description>Web application that assembles the data layer and application layer.</description>
<properties>
<icefaces.version>1.8.1</icefaces.version>
</properties>
<dependencies>
<dependency>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler-app</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>${icefaces.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-facelets</artifactId>
<version>${icefaces.version}</version>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-comps</artifactId>
<version>${icefaces.version}</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.9</version>
<configuration>
<contextPath>/reconciler</contextPath>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>3600000</maxIdleTime>
</connector>
<systemProperties>
<property>
<name>slf4j</name>
<value>false</value>
</property>
<property>
<name>log4j.configuration</name>
<value>file:${basedir}/src/main/webapp/WEB-INF/classes/log4j.properties</value>
</property>
<property>
<name>catalina.home</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>catalina.base</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://192.168.56.1:8080/manager/text</url>
<server>TomcatServer</server>
<path>/tsi-apex-reconciler-web-1.0.18</path>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>TEST</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete
file="${project.build.outputDirectory}/environment.properties" />
<copy file="src/main/resources/environment.test.properties"
tofile="${project.build.outputDirectory}/environment.properties" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>test</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>PROD</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="${project.build.outputDirectory}/PROD.jdbc.properties" />
<delete file="${project.build.outputDirectory}/PROD.jdbc.properties" />
<delete file="${project.build.outputDirectory}//TEST.renderer.properties" />
<delete file="${project.build.outputDirectory}//TEST.renderer.properties" />
<delete file="${project.build.outputDirectory}/jdbc.properties" />
<copy file="src/main/resources/PROD.jdbc.properties"
tofile="${project.build.outputDirectory}/jdbc.properties" />
<delete file="${project.build.outputDirectory}/renderer.properties" />
<copy file="src/main/resources/PROD.renderer.properties"
tofile="${project.build.outputDirectory}/renderer.properties" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Hope these will help.
Best,
Dave

How to generate jar for maven parent project

Maven requires a parent project to have
<packaging>pom</packaging>
clause in the parent's pom.xml. When such a project installed, only a pom-file generated into the maven repository. Jar-file is not generated, no matter if the parent project has any Java code. That forces me to have extra empty parent projects, which is overkill. Logically, some of my libraries could be parents at the same time.
Is there a way to generate both pom and jar files for a parent project without removing/adding the packaging clause between installs?
Use Maven Jar Plugin and Maven Build Helper. Example POM:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>test-${project.version}</file>
<type>jar</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Maven build results:
mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:attach-artifact (attach-artifacts) # test ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default) # test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # test ---
[INFO] Installing /home/username/projects/test/pom.xml to /home/username/.m2/repository/test/test/1.0/test-1.0.pom
[INFO] Installing /home/username/projects/test/test-1.0 to /home/username/.m2/repository/test/test/1.0/test-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.805s
[INFO] Finished at: Thu Sep 06 13:33:20 EDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
A note on Maven practices:
Parent modules are typically where you define the dependencies and plugins used in common by all your child modules. It rarely has output of its own. You probably want to have a "distribution" sub-module that aggregates all your other module artifacts, rather than attempting to do it in the parent module.

Resources