Failed to execute goal org.codehaus.mojo exec-maven-plugin - spring

I have an issue that I spend 5 days without resolving it:
When executing mvn exec:java it fails to correctly parse the configuration arguments, throwing the following error:
"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project poll-translator: An exception occured while executing the Java class. null: InvocationTargetException: Error creating bean with name 'serviceLocator' defined in class path resource [META-INF/dsol/dsol.xml]: Cannot resolve reference to bean 'dsol-service-proxy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dsol-service-proxy' defined in class path resource [META-INF/dsol/dsol.xml]: Instantiation of bean failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.NullPointerException-->null -> [Help 1]"
This is the POM configuration used file (using Apache Maven 3.0.4):
<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>
<parent>
<groupId>org.dsol</groupId>
<artifactId>dsol-parent</artifactId>
<version>1-SNAPSHOT</version>
<relativePath>../dsol/dsol-parent/pom.xml</relativePath>
</parent>
<groupId>org.dsol.project</groupId>
<artifactId>poll-translator</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<dsol.version>0.1-SNAPSHOT</dsol.version>
</properties>
<repositories>
<repository>
<id>dsol.internal</id>
<url>http://maven.dsol-lang.net:8080/archiva/repository/internal/</url>
</repository>
<repository>
<id>dsol.snapshots</id>
<url>http://maven.dsol-lang.net:8080/archiva/repository/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.dsol</groupId>
<artifactId>dsol-interpreter</artifactId>
<version>${dsol.version}</version>
</dependency>
<dependency>
<groupId>org.dsol</groupId>
<artifactId>dsol-default-planner-plugin-impl</artifactId>
<version>${dsol.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.dsol.engine.DSOLServer</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>com.thoughtworks.paranamer</groupId>
<artifactId>paranamer-maven-plugin</artifactId>
<executions>
<execution>
<id>run</id> <!-- id is optional -->
<configuration>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.thoughtworks.paranamer
</groupId>
<artifactId>
paranamer-maven-plugin
</artifactId>
<versionRange>
[2.3,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Idon't know where is the problem and how can i resolve it! Can you help me please?
Regards,
Sana.

The problem is with your spring configuration and not with your maven config.
In your case, when spring tries to create dsol-service-proxy object its constructor requires
serviceLocator which inturn creates serviceLocator and spring encountered some problem in creating your serviceLocator. Check your dsol.xml and make sure serviceLocator is configured correctly.

Another possible solution is that if you have something like this <argument>${env.ANDROID_HOME}/build-tools/android-4.2.2/lib/dx.jar</argument>
, consider adding ANDROID_HOME to environment path variables.

Related

Inconsistent behaviour between maven-surefire and tycho-surefire, with jacoco not generating reports

I'm working on creating a pom for a project and adding test cases to it. The project is an eclipse plugin.
Compiling the project with tycho works just fine, the only problem is during testing:
If I run both maven-surefire-plugin tests and tycho-surefire-plugin-tests, the former performs all the tests as expected, while the latter gives the following error:
Execution test of goal org.eclipse.tycho:tycho-surefire-plugin:1.7.0:test failed: Tycho build extension not configured for MavenProject
I would be perfectly fine to just add <skipTests>true</skipTests> to the tycho-surefire-plugin while keeping maven-surefire-plugin on; the problem is even that way, jacoco refuses to create the coverage site, with the following (non error) message:
Skipping JaCoCo execution due to missing execution data file.
I tried to look for solutions of both, but any combination of the solutions I found doesn't lead me to having a working coverage site.
Maven really makes me quite confused, especially with tycho around, so I'd apreciate any explanation on top of the actual fix.
Here is my pom:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>mygroupid</groupId>
<artifactId>myartifactid</artifactId>
<name>myname</name>
<packaging>eclipse-test-plugin</packaging>
<properties>
<tycho-version>1.7.0</tycho-version>
</properties>
<parent>
<groupId>parentgroupid</groupId>
<artifactId>parent</artifactId>
<version>0.9.5</version>
</parent>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/java/</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<configuration>
<includes>
<include>**/Test_*.java</include>
</includes>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<configuration>
<includes>
<include>**/Test_*.java</include>
</includes>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<configuration>
<output>file</output>
<append>true</append>
<includes>
<include>**/path_to_source/**/*</include>
</includes>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>compiletests</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And here is my parent pom:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>parentgroupid</groupId>
<artifactId>parent</artifactId>
<version>0.9.5</version>
<packaging>pom</packaging>
<modules>
<module>moduleid</module>
</modules>
<properties>
<tycho-version>1.7.0</tycho-version>
</properties>
<repositories>
<repository>
<id>eclipse-2020-06</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/2020-06</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
Of course there won't be any test result for the JaCoCo due to you are using very old Surefire version 2.12.4. This version was not created for JUnit5.
Use the latest version 3.0.0-M5 and see the tutorial.
If you want to have tiny POM, remove the dependency junit-jupiter-engine due to you do not need to have an access to the JUnit internals in your test code. The Surefire will download it shortly before the test runtime.
Your POM has several errors. Let's start with the root cause and then other priorities from high to low.
Whole problem is that Surefire does not know about JaCoCo. You have to tel "him" this way (see jacoco.agent) which "wires" both. Pls ead the documentation in the JaCoCo project:
<properties>
<jvm.args.tests>-Xmx2048m -Xms1024m -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</jvm.args.tests>
<properties>
...
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${jvm.args.tests} ${jacoco.agent}</argLine>
</configuration>
...
The next error is with the way how you use plugins. The plugin jacoco-maven-plugin must be used only in the plugins section. The problem is that you use it also in the dependencies section. You do not want to have it on the classpath. It is job of the property jacoco.agent to put the jacoco agent on the test classpth only but there the JaCoCo plugin must start before the Surefire plugin.
The next thing i do not understand is the config of the compiler. Why you have this?
<executions>
<execution>
<id>compiletests</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
I have second question regarding the packaging. I have never seen this one. It isn't a standard packaging.
<packaging>eclipse-test-plugin</packaging>
Has the Eclipse plugin any special binary form of the archive file?

Error during the deploy with wildfly-maven-plugin

I have a Maven multimodule project with the following structure:
- cotacao
-- cotacao-core
-- cotacao-service
The cotacaoproject is the root, and cotacao-{core,service} are modules. The cotacao-service is an EJB module that has the cotacao-core as a dependency. I'm using wildfly-maven-plugin to deploy the EJB cotacao-service .
Snippets of my pom.xmlare:
(1) The cotacao project:
<groupId>com.tnas</groupId>
<artifactId>cotacao</artifactId>
<version>1.0</version>
<name>Cotacao Parent Project</name>
<packaging>pom</packaging>
<modules>
<module>cotacao-service</module>
<module>cotacao-core</module>
</modules>
(2) The cotacao-core project:
<parent>
<groupId>com.tnas</groupId>
<artifactId>cotacao</artifactId>
<version>1.0</version>
</parent>
<groupId>com.fincatto</groupId>
<artifactId>cotacao-core</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Cotacao Core</name>
(3) The cotacao-service project:
<parent>
<groupId>com.tnas</groupId>
<artifactId>cotacao</artifactId>
<version>1.0</version>
</parent>
<artifactId>cotacao-service</artifactId>
<version>1.0.0</version>
<packaging>ejb</packaging>
...
<dependencies>
...
<dependency>
<groupId>com.fincatto</groupId>
<artifactId>cotacao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly.plugin.version}</version>
<executions>
<execution>
<id>deploy-cotacao-core-dependency</id>
<phase>package</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
</execution>
</executions>
<configuration>
<project>
<dependencies>
<dependency>
<groupId>com.fincatto</groupId>
<artifactId>cotacao-core</artifactId>
</dependency>
</dependencies>
</project>
</configuration>
</plugin>
...
</plugins>
</build>
I'm running the followin Maven goal wildfly:deploy and I'm getting the error:
15:34:03,183 ERROR [org.jboss.as.server] (management-handler-thread - 36) WFLYSRV0021: Deploy of deployment "cotacao-service-1.0.0.jar" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"cotacao-service-1.0.0.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"cotacao-service-1.0.0.jar\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"cotacao-service-1.0.0.jar\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.tnas.cotacao.service.BACENService with ClassLoader ModuleClassLoader for Module \"deployment.cotacao-service-1.0.0.jar:main\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Lcom/fincatto/cotacao/ws/WSConsulta;
Caused by: java.lang.ClassNotFoundException: com.fincatto.cotacao.ws.WSConsulta from [Module \"deployment.cotacao-service-1.0.0.jar:main\" from Service Module Loader]"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"cotacao-service-1.0.0.jar\".POST_MODULE"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
So, I don't know what's the problem with my Maven configurations. How can I use the wildfly-maven-plugin in order to deploy an EJB with the respective dependencies? In my case, the cotacao-core is one of the required dependencies.
Thanks!
I've not found out an elegant way of doing what I want. So, I've worked around this problem with the maven-shade-plugin. The plugin was configured as follow. There are two executions: one for the EJB itself, and another one for the EJB client.
<!-- Usage: mvn:package -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${shade.plugin.version}</version>
<executions>
<execution>
<id>shade-ejb-service</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${ejb.fileName}.jar</outputFile>
<artifactSet>
<includes>
<!-- Here I've included every dependencies -->
<include>groupId:artifactId</include>
</includes>
</artifactSet>
</configuration>
</execution>
<execution>
<id>shade-ejb-client</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>${ejb.fileName}-client.jar</outputFile>
<artifactSet>
<includes>
<!-- Only dependencies for the client -->
<include>groupId:artifactId</include>
</includes>
</artifactSet>
<!-- Filters for selecting specific client classes -->
<filters>
<filter>
<artifact>com.fincatto:cotacao-core</artifact>
<includes>
<include>com/fincatto/cotacao/classes/*</include>
</includes>
</filter>
<filter>
<artifact>com.tnas:cotacao-service</artifact>
<includes>
<include>com/tnas/cotacao/service/remote/*</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
You must 'cotacao-core' installed before do wildfly:deploy:
Try to change execution to install:
<dependencies>
...
<dependency>
<groupId>com.fincatto</groupId>
<artifactId>cotacao-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly.plugin.version}</version>
<executions>
<execution>
<id>deploy-cotacao-core-dependency</id>
<phase>install</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
</execution>
</executions>
<configuration>
<groupId>com.fincatto</groupId>
<artifactId>cotacao-service</artifactId>
</dependency>
</configuration>
</plugin>
...
</plugins>
And simply launches : mvn install

Missing assertion for type [JsonPath Match] error for a Soap UI project CI run

I have configured a CI run for a Soap UI project using Jenkins and Maven. My test steps have Json Path match assertions. Every time it runs, I get errors as
17:46:17,058 ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
17:46:17,058 ERROR [TestAssertionRegistry] Missing assertion for type [JsonPath Match]
Due to the above reason, it skips all the JsonPath assertions associated with a test case step (though assertions like Valid HTTPS are validated successfully).
I am using soapui-maven-plugin:5.1.2 currently. After doing some research over internet, I found if a project is created in a version higher than the version the CI is using, the issue will persist. They recommended to re-write the project with the same version as the system, as explained at SoapUI Testrunner giving error about TestAssertionRegistry . I did but nothing changed.
I have tried soapui-maven-plugin:5.2.1 version but that didn't help either to solve the issue, instead it gave me another error and the build fails
EROR [SoapUI] An error occurred [The plugin 'C:\Users\xyz\.soapuios\plugins\SoapUI-Framework -v1.0.jar' has unsigned class files.
Please help me to fix the issue as the CI would be useless without assertions.
My pom file contains
<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>soapTest</groupId>
<artifactId>soapTest</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.2</version>
<configuration>
<projectFile>C:\Users\xyz\.jenkins\workspace\Soap-uiTest\Test.xml</projectFile>
<outputFolder>${basedir}/target/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<printReport>true</printReport>
<testFailIgnore>true</testFailIgnore>
<!--testSuite>Negative test cases - JSON</testSuite-->
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- Extended Maven antrun plugin -->
<!-- https://maven-antrun-extended-plugin.dev.java.net/ -->
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<executions>
<execution>
<id>test-reports</id>
<phase>test</phase>
<configuration>
<tasks>
<junitreport todir="target/surefire-reports">
<fileset dir="target/surefire-reports">
<include name="**/*.xml"/>
</fileset>
<report format="noframes" todir="target/surefire-reports"/>
</junitreport>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.19.1</version>
</plugin>
</plugins>
</reporting>
</project>

BadCommandLineException with maven cxf XJC plugin

I'm working on a SOA project using CXF to generate SOAP clients.
I need to use the cxf-xjc-boolean plugin to work with Dozer mappings and Boolean attributes, so I followed the docs at http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html and now I have the following pom.xml excerpt:
<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>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<defaultOptions>
<frontEnd>jaxws21</frontEnd>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/wsdl/My.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/My.wsdl</wsdlLocation>
<extraargs>
<extraarg>-xjc-Xboolean</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
...
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>
</project>
When I run the generate-sources goal (either through m2e Eclipse plugin or comman dline) I get this error:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.3:wsdl2java (generate-sources) on project My-BL: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.3:wsdl2java failed: XJC reported 'BadCommandLineException' for -xjc argument:-extension -Xts -target 2.1
How can I fix my pom.xml to have the plunig working?
BTW I noticed that the version 2.7.3 of the plugin (the one, managed, coherent with the version of CXF that I'm using) is not available in the repositories, so I'm using 2.7.0. May this be a problem?
Two things are needed:
Put the cxf-xjc-boolean dependency in the <dependencies> for the plugin, rather than in your project dependencies.
The correct argument is bg (to generate getXYZ() methods) or bgi (to generate getXYZ() and isXYZ() methods) and not boolean.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceRoot>${basedir}/target/generated-sources</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>
${basedir}/src/main/resources/PatientService.wsdl
</wsdl>
<wsdlLocation>classpath:PatientService.wsdl</wsdlLocation>
                <extraargs>
                    <extraarg>-xjc-Xbgi</extraarg>
                </extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>
</plugin>

JMS config settings for jetty deployment using cargo

We have a current web application that is deployed to OAS (Oracle Application Server).
I am trying to implement some functional tests using selenium for this application. I created a new maven project specifically for functional testing, which uses cargo to deploy the application war file (webapp-site.war) to the default container provided by cargo (Jetty). pom.xml attached at the end.
The problem I am facing is in trying to configure jms properties. The current setting in the web application uses OAS specific values from an environment specific jms.properties file (shown below):
java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://localhost:6003:OC4J_DEV/default
java.naming.security.principal=username
java.naming.security.credentials=password
jms.queue.connection.factory.jndi=jms/QueueConnectionFactory
When I start up jetty using cargo, the deployment of the application war fails when it looks for the "RMIInitialContextFactory" and does not find it. This is an OAS specific jar which is not available in the global maven repository. I managed to download and install this jar in the local maven repo, but then it showed a missing class from another oracle specific jar not present in the global maven repo. Also, even I resolved all such dependencies to external jar, I am unsure of how it would perform with Jetty.
It would be really helpful to know how to configure these properties in cargo specific to jetty and have it picked up by the deployable application war.
Attaching the pom.xml of the functional test module below:
<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>
<artifactId>webapp-automation</artifactId>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.webapp</groupId>
<artifactId>webapp</artifactId>
<version>11.0.5</version>
</parent>
<name>Functional tests for webapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<servlet.port>9090</servlet.port>
<seleniumHost>localhost</seleniumHost>
<seleniumPort>4444</seleniumPort>
<selenium.version>2.3</selenium.version>
<selenium.background>true</selenium.background>
</properties>
<dependencies>
<dependency>
<groupId>com.webap</groupId>
<artifactId>webapp-site</artifactId>
<type>war</type>
<version>${project.version.number}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.42.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>${selenium.version}</version>
</plugin>
<!-- CARGO is used to deploy the RAPS application for functional testing -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.2</version>
<configuration>
<container>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
</dependency>
</dependencies>
</container>
<configuration>
<properties>
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
<cargo.datasource.datasource.ojdbc14>
cargo.datasource.driver=oracle.jdbc.driver.OracleDriver|
cargo.datasource.url=jdbc:oracle:thin:#deirbned01.deir.citec.qld.gov.au:1521:RAPSDEV|
cargo.datasource.jndi=jdbc/RAPSDS|
cargo.datasource.username=RAPS_9|
cargo.datasource.password=sm4u
</cargo.datasource.datasource.ojdbc14>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.webapp</groupId>
<artifactId>webapp-site</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Skip the normal tests, we'll run them in the integration-test phase -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>start-cargo</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-cargo</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<executions>
<execution>
<id>start-selenium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
</execution>
<execution>
<id>stop-selenium</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
<configuration>
<background>${selenium.background}</background>
<port>${selenium.port}</port>
<logOutput>true</logOutput>
</configuration>
</plugin>
</plugins>
</build>
Any help would be great !!
Cheers,
Rahul
I found a way of solving the problem.
We use some environment specific settings in the project. I created a new environment profile in the build for functional tests and created a new jms.properties with the initial context factory pointing to the one provided by jetty.
It worked.
Cheers,
Rahul

Resources