Build Failure creating Maven Zip for AWS device Farm - maven

I'm getting a build failure when trying to create a zip for my Appium/selenium project. Any help would be appreciated.
I’m running this on MacOS HighSierra. I’m running this on MacOS HighSierra. Appium is version v1.10.1. The command I used to zip the file (or tried to use to zip the file) is in the first line from the terminal.This is the log from terminal:
cvarl-0046:powerleyappiumcucumber cvarl$ mvn clean package -DskipTests=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestngCucumberBoilerPlate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TestngCucumberBoilerPlate ---
[INFO] Deleting /Users/cvarl/Documents/PowerleyAppiumCucumber/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/cvarl/Documents/PowerleyAppiumCucumber/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # TestngCucumberBoilerPlate ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # TestngCucumberBoilerPlate ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 49 source files to /Users/cvarl/Documents/PowerleyAppiumCucumber/target/test-classes
[INFO] /Users/cvarl/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/cvarl/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # TestngCucumberBoilerPlate ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) # TestngCucumberBoilerPlate ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/cvarl/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.5.4:single (default) # TestngCucumberBoilerPlate ---
[INFO] Reading assembly descriptor: src/main/assembly/zip.xml
[INFO] Building zip: /Users/cvarl/Documents/PowerleyAppiumCucumber/target/zip-with-dependencies.zip
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:copy (copy) # TestngCucumberBoilerPlate ---
[INFO] Configured Artifact: appiumcucumber:appiumcucumberproj:1:.zip
Downloading: https://github.com/igniteram/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1.pom
Downloading: https://repo.maven.apache.org/maven2/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1.pom
[WARNING] The POM for appiumcucumber:appiumcucumberproj:.zip:1 is missing, no dependency information available
Downloading: https://github.com/igniteram/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1..zip
Downloading: https://repo.maven.apache.org/maven2/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1..zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.379 s
[INFO] Finished at: 2019-02-06T17:03:10-05:00
[INFO] Final Memory: 25M/94M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy (copy) on project TestngCucumberBoilerPlate: Unable to find/resolve artifact. Could not find artifact appiumcucumber:appiumcucumberproj:.zip:1 in TestNG-Cucumber (https://github.com/igniteram) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
cvarl-0046:powerleyappiumcucumber cvarl$
This is my 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">
<repositories>
<repository>
<id>TestNG-Cucumber</id>
<name>testng-cucumber</name>
<url>https://github.com/igniteram</url>
</repository>
</repositories>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<groupId>TestngCucumber</groupId>
<artifactId>TestngCucumberBoilerPlate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<type>maven-plugin</type>
</dependency>
<!-- Added for comparing screenshots -->
<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>zip-with-dependencies</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>[ groupId ]</groupId>
<artifactId>[ artifactId ]</artifactId>
<version>[ version ]</version>
<type>[ packaging ]</type>
<classifier> [classifier - optional] </classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
<destFileName>[ filename ]</destFileName>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
</plugin>
</plugins>
</build>
</project>

Changing out my maven-dependency-plugin in the pom.xml with the one below fixed my build failures.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

Related

Build runnable jar file for BDD Serenity Java project using Maven

I have built a BDD Serenity project in IntelliJ using Maven 3.6.3. I need to build a runnable jar file so that the BDD tests can run on another laptop.
I run "mvn clean package" and I get the message "JAR will be empty - no content was marked for inclusion!"
Please help, I am not sure on how to resolve this issue. Below is the output, as well as the POM file.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< equalexperts:hotelbookings >---------------------
[INFO] Building Serenity project with JUnit and WebDriver 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hotelbookings ---
[INFO] Deleting C:\Intelli- Projects\serenity-tutorials\hotelbookings\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hotelbookings ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Intelli- Projects\serenity-tutorials\hotelbookings\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # hotelbookings ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # hotelbookings ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Intelli- Projects\serenity-tutorials\hotelbookings\test
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # hotelbookings ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Intelli- Projects\serenity-tutorials\hotelbookings\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) # hotelbookings ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # hotelbookings ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\Intelli- Projects\serenity-tutorials\hotelbookings\target\hotelbookings-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.740 s
[INFO] Finished at: 2021-01-24T17:38:50+02:00
[INFO] ------------------------------------------------------------------------
4.0.0
<groupId>equalexperts</groupId>
<artifactId>hotelbookings</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Serenity project with JUnit and WebDriver</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>2.3.2</serenity.version>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray-plugins</name>
<url>https://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-assembly-plugin -->
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-assembly-plugin -->
</dependencies>
<build>
<testResources>
<testResource>
<directory>test</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<finalName>ServiceCreate</finalName>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<mainClass>com.svt.optimoo.App</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/Test*.java</include>
<include>**/When*.java</include>
<include>**/*Story.java</include>
</includes>
<argLine>-Xmx512m</argLine>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.version}</version>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
It may be difficult to implement because of such things:
test sources are not included by default into jar since they placed in special directory, following maven`s Convention-Over-Configuration
every "runnable" jar must have the starter class with entry point (public static void main(String[] args) method)
especially integration tests (run by maven-failsafe-plugin) or their parts may use resources inside src/ dir, but not target/test-classes location, where static resources are placed by maven (serenity-maven-plugin does that for report generation)
Though all this points technically may be implemented I bielive, but there is no quarantee for repoduciable behaviour onto another machine with jar file.
Let me advice you to use CI tools, as tibor17 mentiones, or maybe hand-made script with smth like git clone <repo>; cd <repo>; mvn verify

Getting skip non existing resourceDirectory issue while using properties maven plugin iterator plugin and resources plugin

I am trying to use three maven plugin at a time but getting error while executing. My goal is to read each environment properties that will place under src folder like application-sit.properties .. etc.
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>com.test.config</groupId>
<artifactId>config-poc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>config-poc</name>
<build>
<directory>${project.basedir}/target</directory>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/config/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId>
<version>0.5.1</version>
<executions>
<execution>
<id>moving property file</id>
<phase>initialize</phase>
<goals>
<goal>iterator</goal>
</goals>
<configuration>
<items>
<item>sit</item>
<item>uat</item>
</items>
<pluginExecutors>
<pluginExecutor>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
<goal>read-project-properties</goal>
<configuration>
<files>
<file>${project.basedir}/config/resources/environments/common.properties</file>
<file>${project.basedir}/config/resources/environments/#item#.properties</file>
</files>
</configuration>
</pluginExecutor>
<pluginExecutor>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
<goal>copy-resources</goal>
<configuration>
<outputDirectory>${project.build.outputDirectory}/config/${item}/</outputDirectory>
<resources>
<resource>
<directory>${project.build.outputDirectory}</directory>
<filtering>false</filtering>
<include>*.properties</include>
</resource>
</resources>
</configuration>
</pluginExecutor>
</pluginExecutors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Getting below error while executing looks like read property plugin is not generating application.properties inside target folder. Below is the snapshot of my project.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.test.config:config-poc >---------------------
[INFO] Building config-poc 0.0.1-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # config-poc ---
[INFO]
[INFO] --- iterator-maven-plugin:0.5.1:iterator (moving property file) # config-poc ---
[INFO] ------ (sit) org.codehaus.mojo:properties-maven-plugin:1.0.0:read-project-properties
[INFO] ------ (sit) org.apache.maven.plugins:maven-resources-plugin:2.7:copy-resources
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\eclipse\F\eclipse_workspace3\config-poc\target\classes
[INFO] ------ (uat) org.codehaus.mojo:properties-maven-plugin:1.0.0:read-project-properties
[INFO] ------ (uat) org.apache.maven.plugins:maven-resources-plugin:2.7:copy-resources
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\eclipse\F\eclipse_workspace3\config-poc\target\classes
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # config-poc ---
[INFO] Installing C:\eclipse\F\eclipse_workspace3\config-poc\pom.xml to C:\Users\Abhishek\.m2\repository\com\test\config\config-poc\0.0.1-SNAPSHOT\config-poc-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.798 s
[INFO] Finished at: 2020-08-29T16:29:36+05:30
[INFO] ------------------------------------------------------------------------
Below pluginExecutor structure will solve your problem.
<pluginExecutor>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<goal>copy-resources</goal>
<configuration>
<outputDirectory>${project.build.outputDirectory}/${item}/</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/config/resources/templates</directory>
<filtering>false</filtering>
<include>application.properties</include>
</resource>
</resources>
</configuration>

mvn does not run test on appCenter

I want to run my appium test on AppCenter and I have followed this documents
https://learn.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/appium#prerequisites
When I run appium script on appCenter it does not show any error but give me output as
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------
[INFO] Building run-test 1.0-SNAPSHOT
[INFO] ----------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # run-test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # run-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # run-test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # run-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.20:test (default-test) # run-test ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.testscripts.RegressionTest
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.247 s - in com.testscripts.RegressionTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # run-test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: target/run-test-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-failsafe-plugin:2.20:integration-test (default) # run-test ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO]
[INFO] --- maven-failsafe-plugin:2.20:verify (default) # run-test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.623 s
[INFO] Finished at: 2018-08-06T07:39:58+02:00
[INFO] Final Memory: 17M/214M
[INFO] ------------------------------------------------------------------------
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>Cure.fit</groupId>
<artifactId>Cure.fit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Automation Test Project</name>
<description>Automation Test Project</description>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.appium/java-client -->
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.appcenter</groupId>
<artifactId>appium-test-extension</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
<profiles>
<profile>
<id>repl</id>
<dependencies>
<dependency>
<groupId>com.javarepl</groupId>
<artifactId>javarepl</artifactId>
<version>428</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<executable>java</executable>
<classpathScope>test</classpathScope>
<arguments>
<argument>-Djansi.passthrough=true</argument>
<argument>-classpath</argument>
<classpath />
<argument>javarepl.Main</argument>
</arguments>
</configuration>
<executions>
<execution>
<id>runRepl</id>
<phase>process-test-classes</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Added for AppCenter/Test runs -->
<profile>
<id>prepare-for-upload</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/upload/dependency-jars/</outputDirectory>
<useRepositoryLayout>true</useRepositoryLayout>
<copyPom>true</copyPom>
<addParentPoms>true</addParentPoms>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>generate-pom</id>
<phase>package</phase>
<goals>
<goal>effective-pom</goal>
</goals>
<configuration>
<output>${project.build.directory}/upload/pom.xml</output>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-testclasses</id>
<phase>package</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/upload/test-classes</outputDirectory>
<resources>
<resource>
<directory>
${project.build.testOutputDirectory}
</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
When I run the same project as mvn test I am able to run the test.
I have kept my JUnit testcase name as RegressionTest.java under src/test/java which extends Support.java which is also Junit file.
Could any one can help me what is the mistake I am doing.

Unable to execute wsdl2java with maven

I want to execute wsdl2java with maven but I have the following build failure :
[INFO] --- maven-dependency-plugin:2.1:copy (default) # mogopay ---
[INFO] Configured Artifact: javax.xml.bind:jaxb-api:2.2:jar
[INFO] Configured Artifact: javax.xml.ws:jaxws-api:2.2:jar
[INFO] Copying jaxb-api-2.2.jar to c:\Users\EBIZNEXT\git\mogopay-core\mogopay\target\endorsed\jaxb-api-2.2.jar
[INFO] Copying jaxws-api-2.2.jar to c:\Users\EBIZNEXT\git\mogopay-core\mogopay\target\endorsed\jaxws-api-2.2.jar
[INFO]
[INFO] --- maven-antrun-plugin:1.3:run (copy-tomcat-resources) # mogopay ---
[INFO] Executing tasks
[INFO] Executed tasks
[INFO]
[INFO] --- cxf-codegen-plugin:2.4.2:wsdl2java (CXF Payline) # mogopay ---
[INFO] Running wsdl2java in fork mode...
[INFO] Building jar: C:\Users\EBIZNEXT\AppData\Local\Temp\cxf-tmp-679212\cxf-codegen5225275003143491559.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:30.351s
[INFO] Finished at: Tue Jan 22 18:28:57 CET 2013
[INFO] Final Memory: 14M/178M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.4.2:wsdl2java (CXF Payline) on project mogopay:
[ERROR] Exit code: 1 - Exception in thread "main" org.apache.cxf.tools.common.ToolException: java.lang.reflect.UndeclaredThrowableException
[ERROR] at
...
[ERROR] Caused by: java.lang.NoSuchMethodException: javax.xml.bind.annotation.XmlElementRef.required()
[ERROR] at java.lang.Class.getDeclaredMethod(Class.java:1954)
[ERROR] at com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.java:107)
[ERROR] ... 27 more
[ERROR]
[ERROR] Command line was: "c:\Program Files\Java\jdk1.7.0\jre\bin\java.exe" -Djava.endorsed.dirs=c:\Users\EBIZNEXT\git\mogopay-core\mogopay\target/endorsed -jar
C:\Users\EBIZNEXT\AppData\Local\Temp\cxf-tmp-679212\cxf-codegen5225275003143491559.jar C:\Users\EBIZNEXT\AppData\Local\Temp\cxf-tmp-679212\cxf-w2j3628405823287
641812args
This project is built in grails 2.0.3. It seems that the problem comes from Jaxb because the current version in grails uses jaxb-api-2.1 while the project needs jaxb 2.2. I have updated my pom as it has been suggested from this answer : Set Java Compliance Level in CXF wsdl2java and also here : Example 7 - Using JAXB/JAX-WS 2.2 with Java 6. But when I execute maven command : mvn clean install, I get the error above.
Here is my pom (I removed the unimportant parts):
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<endorseddirs>${project.build.directory}/endorsed</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2</version>
</artifactItem>
<artifactItem>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/endorsed</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
...
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<fork>once</fork>
<additionalJvmArgs>-Djava.endorsed.dirs=${project.build.directory}/endorsed</additionalJvmArgs>
</configuration>
<dependencies>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>CXF Payline</id>
<phase>process-resources</phase>
<configuration>
<sourceRoot>${basedir}/src/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/java/wsdl/Payline_DirectPaymentAPI.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Any suggestion would be appreciated
Java 7 already includes jaxb 2.2 (actualy 2.2.4-1 as you can see here), so you don't need to add any dependency to that artifact. If this artifact conflicts with grails 2.0.3 dependencies, try excluding jaxb from grails dependency, maybe grails is happy with jaxb 2.2.
This should be a comment, but I'm begind a proxy that filters javascript and I cannot use comments feature. Sorry for my English to!

maven and aspectj plugin - tests hang

I am using the aspectj-maven-plugin when trying to weave my aspect into my application. The problem I am seeing is that the compilation and weaving seems to run fine, but whenever it gets to the test phase it simply hangs. I have included a section from my pom.xml
<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>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.7</version>
</dependency>
</dependencies>
This is the output I get:
[INFO] Compiling 7 source files to /home/***/target/classes
[INFO] [aspectj:compile {execution: default}]
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/***/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 5 source files to /home/***/target/test-classes
[INFO] [aspectj:test-compile {execution: default}]
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /home/***/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.example.MyTest
Has anyone else seen this behaviour / know how to fix it?
Putting this here in case someone did as I was doing. The reason the test was hanging was because of the aspect pointcut.
call(* *.*(..))
After this I had an advice that was called before the pointcut. However this creating a cyclic condition, and was hanging my tests. doh!

Resources