Heroku Springboot Err: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile - reactjs

I am trying to get my Springboot Backend application to compile on Heroku.
I get the message: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile
I am totally lost and in the weeds on this.
Any help would be appreciated.
I do not even know how or where to add the -e or -X switch (referenced below).
Here is the applicable portion of the log and my POM file.
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar (317 kB at 10 MB/s)
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # budget-backend ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /tmp/build_edc50946/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # budget-backend ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /tmp/build_edc50946/target/test-classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.635 s
[INFO] Finished at: 2022-03-07T15:09:33Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project budget-backend: Fatal error compiling: invalid target release: 11 -> [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
! ERROR: Failed to build app with Maven
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>net.javaguides</groupId>
<artifactId>budget-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>budget-backend</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I added a system.properties file with 'java.runtime.version=11' and the error message from Heroku now says:
Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:repackage failed: Unable to find main class
Did I make things worse or am I getting closer?

Problem solved. I do not understand why, but it compiles on Heroku now.
I added a system.properties file with the following entry
java.runtime.version=11.
I also changed the POM to read
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>

Related

Error when generating allure report with jasmine allure reporter

I am using jasmine allure reporter. When I ran My test suite got pom.xml generated. But when I wanted to run "mvn site -Dallure.results_pattern=allure-results" command in target directery, getting the following error. Any help highly appreciated.
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 ski
n.
[INFO] Generating "Allure" report --- allure-maven-plugin:2.2
[INFO] Report Version: 1.4.15
[INFO] Results Pattern: allure-results
[INFO] Found [0] results directories by pattern [allure-results]
[INFO] Found [0] plugins
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:44 min
[INFO] Finished at: 2016-09-02T17:54:15+05:30
[INFO] Final Memory: 19M/161M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:si
te (default-site) on project protractor-allure-plugin-generate-html: Error during page generation: Error rendering Maven report: Can't find any results directories by pattern [allure-results] -> [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, pleaseread the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
my pom.xml is:
<?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>ru.yandex.allure</groupId>
<artifactId>protractor-allure-plugin-generate-html</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<allure.version>1.4.15</allure.version>
<allure.maven.version>2.2</allure.maven.version>
<!-- Relative to the dir you're running from -->
<allure.results_pattern>allure-results</allure.results_pattern>
</properties>
<dependencies>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-report-face</artifactId>
<version>${allure.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
<configuration>
<webAppSourceDirectory>target/site/allure-maven-plugin</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>2299</stopPort>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>${allure.maven.version}</version>
<configuration>
<resultsPattern>${allure.results_pattern}</resultsPattern>
<!--<reportVersion>1.4.15</reportVersion>-->
</configuration>
</plugin>
</plugins>
</reporting>
</project>

Creating a single camel application bundle with all dependencies using maven3

I am trying to create a camel application bundle so that I can run it in service mix 6.1.0 under karaf.
As per Ralf I tried the KAR format. My pom.xml looks like 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>
<groupId>com.jabong.orchestratorservice</groupId>
<artifactId>basecomponent</artifactId>
<version>1.0</version>
<packaging>kar</packaging>
<name>basecomponent</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>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.github.arnabk</groupId>
<artifactId>java-dogstatsd-client</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20151123</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.13</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>2.16.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>
com.googlecode.maven-java-formatter-plugin
</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.0.13</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>easyb</id>
<!-- When maven.test.skip is defined, don't run easyb tests. Ideally,
it should check for skipTests flag too,but maven profile activation doesn't
support multiple variables. More details is here http://jira.codehaus.org/browse/MNG-3328.
There is also easyb ticket created for this issue: https://code.google.com/p/easyb/issues/detail?id=192. -->
<activation>
<property>
<name>!maven.test.skip</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.easyb</groupId>
<artifactId>maven-easyb-plugin</artifactId>
<version>0.9</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<storyType>html</storyType>
<storyReport>${project.build.directory}/easyb/stories.txt</storyReport>
</configuration>
</plugin>
<plugin>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<version>0.4</version>
<configuration>
<compilerSource>1.8</compilerSource>
<compilerCompliance>1.8</compilerCompliance>
<compilerTargetPlatform>1.8</compilerTargetPlatform>
<configFile>${project.basedir}/code_format_java.xml</configFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Description>${project.description}</Bundle-Description>
<Import-Package>*;resolution:=optional</Import-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>4.0.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
On doing mvn install I am getting the below error:-
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.jabong.orchestratorservice:basecomponent:kar:1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. # line 152, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building basecomponent 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # basecomponent ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- karaf-maven-plugin:4.0.0:features-generate-descriptor (default-features-generate-descriptor) # basecomponent ---
[INFO] Generating feature descriptor file /home/jabong/code/github.com/jabong/orchestrator-service/basecomponent/target/feature/feature.xml
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar
Exception in thread "pool-1-thread-1" java.lang.NoSuchMethodError: org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.getReadTimeout()I
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:798)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1000)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:977)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.574s
[INFO] Finished at: Wed Feb 24 23:12:56 IST 2016
[INFO] Final Memory: 21M/341M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.0:features-generate-descriptor (default-features-generate-descriptor) on project basecomponent: Execution default-features-generate-descriptor of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.0:features-generate-descriptor failed: An API incompatibility was encountered while executing org.apache.karaf.tooling:karaf-maven-plugin:4.0.0:features-generate-descriptor: java.lang.NoSuchMethodError: org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.getReadTimeout()I
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.karaf.tooling:karaf-maven-plugin:4.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jabong/.m2/repository/org/apache/karaf/tooling/karaf-maven-plugin/4.0.0/karaf-maven-plugin-4.0.0.jar
[ERROR] urls[1] = file:/home/jabong/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/home/jabong/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/home/jabong/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[4] = file:/home/jabong/.m2/repository/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.jar
[ERROR] urls[5] = file:/home/jabong/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[6] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[7] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[8] = file:/home/jabong/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[9] = file:/home/jabong/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[10] = file:/home/jabong/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
[ERROR] urls[11] = file:/home/jabong/.m2/repository/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8.jar
[ERROR] urls[12] = file:/home/jabong/.m2/repository/org/apache/maven/wagon/wagon-http-shared/2.8/wagon-http-shared-2.8.jar
[ERROR] urls[13] = file:/home/jabong/.m2/repository/org/jsoup/jsoup/1.7.2/jsoup-1.7.2.jar
[ERROR] urls[14] = file:/home/jabong/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[15] = file:/home/jabong/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
[ERROR] urls[16] = file:/home/jabong/.m2/repository/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar
[ERROR] urls[17] = file:/home/jabong/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] urls[18] = file:/home/jabong/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar
[ERROR] urls[19] = file:/home/jabong/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar
[ERROR] urls[20] = file:/home/jabong/.m2/repository/org/apache/karaf/org.apache.karaf.util/4.0.0/org.apache.karaf.util-4.0.0.jar
[ERROR] urls[21] = file:/home/jabong/.m2/repository/org/apache/felix/org.apache.felix.utils/1.8.0/org.apache.felix.utils-1.8.0.jar
[ERROR] urls[22] = file:/home/jabong/.m2/repository/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar
[ERROR] urls[23] = file:/home/jabong/.m2/repository/org/apache/karaf/jaas/org.apache.karaf.jaas.boot/4.0.0/org.apache.karaf.jaas.boot-4.0.0.jar
[ERROR] urls[24] = file:/home/jabong/.m2/repository/org/slf4j/slf4j-jdk14/1.7.12/slf4j-jdk14-1.7.12.jar
[ERROR] urls[25] = file:/home/jabong/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-4/maven-filtering-1.0-beta-4.jar
[ERROR] urls[26] = file:/home/jabong/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[27] = file:/home/jabong/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
[ERROR] urls[28] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] urls[29] = file:/home/jabong/.m2/repository/org/apache/felix/maven-bundle-plugin/2.5.4/maven-bundle-plugin-2.5.4.jar
[ERROR] urls[30] = file:/home/jabong/.m2/repository/biz/aQute/bnd/biz.aQute.bndlib/2.4.1/biz.aQute.bndlib-2.4.1.jar
[ERROR] urls[31] = file:/home/jabong/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[32] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
[ERROR] urls[33] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
[ERROR] urls[34] = file:/home/jabong/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
[ERROR] urls[35] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
[ERROR] urls[36] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar
[ERROR] urls[37] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar
[ERROR] urls[38] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[39] = file:/home/jabong/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
[ERROR] urls[40] = file:/home/jabong/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[41] = file:/home/jabong/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[42] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar
[ERROR] urls[43] = file:/home/jabong/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
[ERROR] urls[44] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar
[ERROR] urls[45] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar
[ERROR] urls[46] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar
[ERROR] urls[47] = file:/home/jabong/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar
[ERROR] urls[48] = file:/home/jabong/.m2/repository/org/apache/felix/org.apache.felix.fileinstall/3.5.0/org.apache.felix.fileinstall-3.5.0.jar
[ERROR] urls[49] = file:/home/jabong/.m2/repository/org/apache/karaf/features/org.apache.karaf.features.core/4.0.0/org.apache.karaf.features.core-4.0.0.jar
[ERROR] urls[50] = file:/home/jabong/.m2/repository/org/apache/karaf/profile/org.apache.karaf.profile.core/4.0.0/org.apache.karaf.profile.core-4.0.0.jar
[ERROR] urls[51] = file:/home/jabong/.m2/repository/org/apache/felix/org.apache.felix.resolver/1.4.0/org.apache.felix.resolver-1.4.0.jar
[ERROR] urls[52] = file:/home/jabong/.m2/repository/org/ops4j/pax/url/pax-url-wrap/2.4.1/pax-url-wrap-2.4.1-uber.jar
[ERROR] urls[53] = file:/home/jabong/.m2/repository/org/ops4j/base/ops4j-base-net/1.4.0/ops4j-base-net-1.4.0.jar
[ERROR] urls[54] = file:/home/jabong/.m2/repository/org/ops4j/base/ops4j-base-lang/1.5.0/ops4j-base-lang-1.5.0.jar
[ERROR] urls[55] = file:/home/jabong/.m2/repository/org/ops4j/base/ops4j-base-monitors/1.4.0/ops4j-base-monitors-1.4.0.jar
[ERROR] urls[56] = file:/home/jabong/.m2/repository/org/ops4j/pax/swissbox/pax-swissbox-bnd/1.8.1/pax-swissbox-bnd-1.8.1.jar
[ERROR] urls[57] = file:/home/jabong/.m2/repository/biz/aQute/bnd/bndlib/2.4.0/bndlib-2.4.0.jar
[ERROR] urls[58] = file:/home/jabong/.m2/repository/org/ops4j/pax/url/pax-url-commons/2.4.1/pax-url-commons-2.4.1.jar
[ERROR] urls[59] = file:/home/jabong/.m2/repository/org/ops4j/pax/swissbox/pax-swissbox-property/1.8.1/pax-swissbox-property-1.8.1.jar
[ERROR] urls[60] = file:/home/jabong/.m2/repository/org/ops4j/base/ops4j-base-util-property/1.5.0/ops4j-base-util-property-1.5.0.jar
[ERROR] urls[61] = file:/home/jabong/.m2/repository/org/ops4j/pax/url/pax-url-aether/2.4.1/pax-url-aether-2.4.1.jar
[ERROR] urls[62] = file:/home/jabong/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.12/jcl-over-slf4j-1.7.12.jar
[ERROR] urls[63] = file:/home/jabong/.m2/repository/org/ops4j/pax/url/pax-url-war/2.4.1/pax-url-war-2.4.1-uber.jar
[ERROR] urls[64] = file:/home/jabong/.m2/repository/org/ops4j/pax/swissbox/pax-swissbox-optional-jcl/1.8.1/pax-swissbox-optional-jcl-1.8.1.jar
[ERROR] urls[65] = file:/home/jabong/.m2/repository/org/apache/karaf/deployer/org.apache.karaf.deployer.spring/4.0.0/org.apache.karaf.deployer.spring-4.0.0.jar
[ERROR] urls[66] = file:/home/jabong/.m2/repository/org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/4.0.0/org.apache.karaf.deployer.blueprint-4.0.0.jar
[ERROR] urls[67] = file:/home/jabong/.m2/repository/org/apache/karaf/deployer/org.apache.karaf.deployer.features/4.0.0/org.apache.karaf.deployer.features-4.0.0.jar
[ERROR] urls[68] = file:/home/jabong/.m2/repository/org/apache/karaf/deployer/org.apache.karaf.deployer.kar/4.0.0/org.apache.karaf.deployer.kar-4.0.0.jar
[ERROR] urls[69] = file:/home/jabong/.m2/repository/org/apache/karaf/kar/org.apache.karaf.kar.core/4.0.0/org.apache.karaf.kar.core-4.0.0.jar
[ERROR] urls[70] = file:/home/jabong/.m2/repository/org/apache/karaf/shell/org.apache.karaf.shell.console/4.0.0/org.apache.karaf.shell.console-4.0.0.jar
[ERROR] urls[71] = file:/home/jabong/.m2/repository/jline/jline/2.12.1/jline-2.12.1.jar
[ERROR] urls[72] = file:/home/jabong/.m2/repository/org/apache/karaf/jaas/org.apache.karaf.jaas.modules/4.0.0/org.apache.karaf.jaas.modules-4.0.0.jar
[ERROR] urls[73] = file:/home/jabong/.m2/repository/org/apache/karaf/jaas/org.apache.karaf.jaas.config/4.0.0/org.apache.karaf.jaas.config-4.0.0.jar
[ERROR] urls[74] = file:/home/jabong/.m2/repository/org/apache/karaf/shell/org.apache.karaf.shell.core/4.0.0/org.apache.karaf.shell.core-4.0.0.jar
[ERROR] urls[75] = file:/home/jabong/.m2/repository/org/apache/sshd/sshd-core/0.14.0/sshd-core-0.14.0.jar
[ERROR] urls[76] = file:/home/jabong/.m2/repository/org/apache/commons/commons-compress/1.9/commons-compress-1.9.jar
[ERROR] urls[77] = file:/home/jabong/.m2/repository/org/osgi/org.osgi.core/6.0.0/org.osgi.core-6.0.0.jar
[ERROR] urls[78] = file:/home/jabong/.m2/repository/org/apache/xbean/xbean-finder-shaded/3.18/xbean-finder-shaded-3.18.jar
[ERROR] urls[79] = file:/home/jabong/.m2/repository/org/apache/xbean/xbean-asm5-shaded/3.18/xbean-asm5-shaded-3.18.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>com.jabong.orchestratorservice:basecomponent:1.0, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [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/PluginContainerException
jabong#jabong1143:~/code/github.com/jabong/orchestrator-service/basecomponent$
Karaf version is reporting 3.0.5.
karaf#root>info
Karaf
Karaf version 3.0.5
Karaf home /home/jabong/Downloads/software/dev/apache-servicemix-6.1.0
Karaf base /home/jabong/Downloads/software/dev/apache-servicemix-6.1.0
Karaf etc /home/jabong/Downloads/software/dev/apache-servicemix-6.1.0/etc
OSGi Framework org.apache.felix.framework - 4.2.1
So tried karaf-maven-plugin with version 3.0.5. But still getting same error.
The error seems to be an issue with maven 3.0.4 that I was using as mentioned here. After upgrading maven to 3.2.5 I am not getting the issue.
I cannot tell what causes your exact problem, but there are several issues with your POM file:
You should not define a packaging type that is implemented in a bundle you only pull in if a certain profile is active.
The packaging type has to be bundle, not kar. Instead you trigger the creation of the feature descriptor and KAR artifact via the karaf plugin configuration.
The Karaf plugin version should match your Karaf version.
You should define the Camel version (better all versions of your dependencies) as a property in your POM so it can be re-used in several places.
Karaf ships with Camel. Instead of loading Camel bundles one by one through your generated feature file, driven by the POM, you can set the scope of all your Camel dependencies to provided and instead declare a feature dependency in a template feature.xml. This is more the KAR/feature way of doing things, but less the Maven way as your POM does not drive all your dependencies anymore. Your choice.
I suggest a POM along these lines:
<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>your-artifact</artifactId>
<packaging>bundle</packaging>
<properties>
<camel.version>2.16.1</camel.version>
<!-- ... -->
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<!-- Documentation at http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
<!-- Documentation at https://karaf.apache.org/manual/latest/developers-guide/karaf-maven-plugin.html -->
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<configuration>
<aggregateFeatures>false</aggregateFeatures>
<includeTransitiveDependency>true</includeTransitiveDependency>
</configuration>
<executions>
<execution>
<id>generate-karaf-artifacts</id>
<goals>
<goal>features-generate-descriptor</goal>
<goal>kar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
<scope>provided</scope>
</dependency>
<!-- ... -->
</dependencies>
</project>
Create a template feature.xml in src/main/feature like so:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="your-feature-repo-name">
<feature name="${project.artifactId}" version="${project.version}" description="Describe your feature">
<feature version="${camel.version}">camel-jetty</feature>
<feature version="${camel.version}">camel-netty4-http</feature>
<!-- This is to pull in the bundle you built. -->
<bundle start-level="91">mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
</feature>
</features>
The template is picked up by the Karaf plugin and it adds the rest of your dependencies to this template. Check out the result after the build in target/feature/feature.xml and/or in the KAR artifact.

Unable to invoke avro-maven plugin

My question is similar to Unable to compile and create .avro file from .avsc using Maven
I have tried all possible things, checked the maven project 100 times, still i am not able to run the avro-maven plugin to generate the code for my avsc file.
i have read the following posts and followed the same, but to no success
http://grepalex.com/2013/05/24/avro-maven/
https://github.com/phunt/avro-maven-plugin
i downloaded the above maven project, and here also the result is same.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Avro Maven Example 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # avro-maven ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # avro-maven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\01_Work\FLink\avro-maven-master\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # avro-maven ---
[INFO] No sources to compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.932 s
[INFO] Finished at: 2015-08-10T19:16:44+05:30
[INFO] Final Memory: 6M/16M
[INFO] ------------------------------------------------------------------------
But no generated code.
I strongly feel Maven is my mortal enemy and i will never be able to do any work with apache projects just because i cannot get maven to work. perhaps i should consider going back to saner world of C/C++ where it doesnt require an internet connection to compile my source.
That eclipse error in pom file doesn't matters. Make sure that your .avsc file has namespace value, where actual file is getting generated.
{
"namespace": "com.hadoop.practice.avro",
"type": "record",
"name": "StringPair",
"doc": "A pair of strings",
"fields": [
{"name": "left", "type": "string"},
{"name": "right", "type": "string"}
]
}
StringPair.java get generated under this namespace defined package
I publish a simple demo which is fully tested and 100% works https://github.com/xmeng1/avro-maven-demo.
There are two important things for generating code by using the Avro
The configuration: if we want to generate code when mvn compile or mvn package, we can put configuration under the execution. If we want to generate code when running goal mvn avro:scheme, we need put the configuration to the plugin directly. (the demo includes two type configuration)
The namespace of the scheme file which will decide which package the generate code will belong to. {"namespace": "com.xx.xx.demo", "name": "Foo"}, the Foo.java will be created under the package com.xx.xx.demo
Below is a sample POM file that I've successfully used. My guess is that your sourceDirectory & outputDirectory tags weren't properly defined...
<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.example</groupId>
<artifactId>helloworld</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<!-- Keep Hadoop versions as properties to allow easy modification -->
<hadoop.version>2.6.0-cdh5.4.0</hadoop.version>
<avro.version>1.7.7</avro.version>
<mrunit.version>1.1.0</mrunit.version>
<!-- Maven properties for compilation -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-tools</artifactId>
<version>${avro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.mrunit</groupId>
<artifactId>mrunit</artifactId>
<version>${mrunit.version}</version>
<classifier>hadoop2</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Set the Java target version to 1.7 -->
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
</project>
I've struggled with it for some time yesterday. Actual reason was my mistake: default pom.xml configuration which I got by calling mvn archetype:generate had all <plugin/> tags inside <plugin-management/> section, while I had to add my <plugin/> tag just inside <plugins> root! That was my mistake, and it was really simple to fix, but very tricky to understand while you see lots of plugins defined nearby all in different way!
So finally it had to look like (pay attention to <plugin-management> with lots of pre-defined plugins!):
<build>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.8.2</version>
<configuration>
<!--The Avro source directory for schema, protocol and IDL files.-->
<sourceDirectory>${project.basedir}/src/main/resources/</sourceDirectory>
<!--The directory where Avro writes code-generated sources. IMPORTANT!! -->
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
<executions>
<execution>
<id>avro-schemas</id>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
<goal>protocol</goal>
<goal>idl-protocol</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
As mentioned in comments , I put a surrounding <pluginManagement> tag over <plugins> and it resolved issue for me. I am using eclipse Mars.
Example :
<pluginManagement>
<plugins>
<plugin>....</plugin>
</plugins>
<pluginManagement>

org.apache.maven.plugins:maven-compiler-plugin is missing

Hi I am new in automation testing
I am using:
Eclipse: Eclipse IDE for Java Developers
Version: Indigo Service Release 2
Build id: 20120216-1857
And apache maven version: apache-maven-3.0.4
I am facing problem to run automation script through maven and the error is:
D:\TestAutomation\MyTestProject_24>mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for MyTestProject_24:MyTestProject_24:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for org.sikuli:sikuli-java:jar should use a variable
instead of a hard-coded path C:\SikuliX\sikuli-java.jar # line 109, column 18
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missi
ng. # line 125, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your
build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyTestProject24 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # MyTestProject_24 ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # MyTestProject_24 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) #MyTestProject_24 ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # MyTestProject_24 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # MyTestProject_24 ---
[INFO] Surefire report directory: D:\TestAutomation\MyTestProject_24\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.531s
[INFO] Finished at: Mon Nov 17 11:41:00 IST 2014
[INFO] Final Memory: 7M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project MyTestProject_24: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] Cannot instantiate class WebConsoleTest.WebConsoleLoginTest
[ERROR] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
[ERROR] at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387)
[ERROR] at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299)
[ERROR] at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
[ERROR] at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186)
[ERROR] at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120)
[ERROR] at org.testng.TestRunner.initMethods(TestRunner.java:409)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:235)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:205)
[ERROR] at org.testng.TestRunner.<init>(TestRunner.java:153)
[ERROR] at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522)
[ERROR] at org.testng.SuiteRunner.init(SuiteRunner.java:157)
[ERROR] at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
[ERROR] at org.testng.TestNG.createSuiteRunner(TestNG.java:1273)
[ERROR] at org.testng.TestNG.createSuiteRunners(TestNG.java:1260)
[ERROR] at org.testng.TestNG.runSuitesLocally(TestNG.java:1114)
[ERROR] at org.testng.TestNG.run(TestNG.java:1031)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:293)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:91)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBoote
r.java:200)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: java.lang.reflect.InvocationTargetException
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
57)
[ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
pl.java:45)
[ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[ERROR] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
[ERROR] ... 22 more
[ERROR] Caused by: java.lang.NoClassDefFoundError: testlink/api/java/client/TestLinkAPIException
[ERROR] at WebConsoleTest.WebConsoleLoginTest.<init>(WebConsoleLoginTest.java:35)
[ERROR] ... 27 more
[ERROR] Caused by: java.lang.ClassNotFoundException: testlink.api.java.client.TestLinkAPIException
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[ERROR] ... 28 more
[ERROR] -> [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 arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
D:\TestAutomation\MyTestProject_24>
And POM.xml is:
<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>MyTestProject_24</groupId>
<artifactId>MyTestProject_24</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>MyTestProject24</name>
<dependencies>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.grid</groupId>
<artifactId>selenium-grid-hub</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.28.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.28.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<dependency>
<groupId>net.schmizz</groupId>
<artifactId>sshj</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.27</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>0.9.27</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.sikuli</groupId>
<artifactId>sikuli-java</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>C:\SikuliX\sikuli-java.jar</systemPath>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.sikuli</groupId>
<artifactId>sikuli-core</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.5.1</version>
<dependencies>
<dependency>
<groupId>br.eti.kinoshita</groupId>
<artifactId>testlink-java-api</artifactId>
<version>1.9.6-1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
To fix this issue, add the <version> tag as shown below:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
.
.
.
</pluginManagement>
</build>
Note - This version number I have extracted from the Maven log that you have provided.

PlayN skeleton project html module can't find core module in maven?

Based on the PlayN Getting Started wiki page I created a skeleton project (called GuiPoc) in eclipse. I managed to make the guipoc-html project compile successfully (with Google -> GWT Compile), and eventually Run as -> Web Application. I tried using mvn gae:run from the guipoc/html directory (in cygwin) as per the wiki, and got the following output:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GuiPoc HTML 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-gae-plugin:0.9.2:run (default-cli) # guipoc-html >>>
[WARNING] The POM for com.mydomain.mynamespace:guipoc-core:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.619s
[INFO] Finished at: Sun Jan 01 20:05:29 VET 2012
[INFO] Final Memory: 8M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project guipoc-html: Could not resolve dependencies for project com.mydomain.mynamespace:guipoc-html:war:0.0.1-SNAPSHOT: Failure to find com.mydomain.mynamespace:guipoc-core:jar:0.0.1-SNAPSHOT in http://forplay.googlecode.com/svn/mavenrepo was cached in the local repository, resolution will not be reattempted until the update interval of forplay-legacy has elapsed or updates are forced -> [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/DependencyResolutionException
Actual Question:
I don't understand why it's looking for the dependency in the system repository instead of the local directory. What am I doing wrong? Do I need to change something in my pom.xml files? Create a settings.xml in my C:\Users\MyName.m2 directory and set something there?
Here is the content of guipoc/html/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mydomain.mynamespace</groupId>
<artifactId>guipoc</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>guipoc-html</artifactId>
<packaging>war</packaging>
<name>GuiPoc HTML</name>
<properties>
<gwt.module>com.mydomain.mynamespace.GuiPoc</gwt.module>
<gwt.name>guipoc</gwt.name>
<!-- Desired Google App Engine SDK version -->
<gae.version>1.6.0</gae.version>
</properties>
<dependencies>
<dependency>
<groupId>com.mydomain.mynamespace</groupId>
<artifactId>guipoc-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-html</artifactId>
<version>${playn.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
<additionalBuildcommands>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
</buildCommand>
</additionalBuildcommands>
<additionalProjectnatures>
<projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
<projectnature>com.google.appengine.eclipse.core.gaeNature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.9.2</version>
<dependencies>
<!--
Declare explicit dependency on gae-runtime here,
so we can specify the App Engine SDK version
-->
<dependency>
<groupId>net.kindleit</groupId>
<artifactId>gae-runtime</artifactId>
<version>${gae.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Here is the content of guipoc/core/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mydomain.mynamespace</groupId>
<artifactId>guipoc</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>guipoc-core</artifactId>
<packaging>jar</packaging>
<name>GuiPoc Core</name>
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${playn.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
<resources>
<!-- include the source files in our main jar for use by GWT -->
<resource>
<directory>${project.build.sourceDirectory}</directory>
</resource>
<!-- and continue to include our standard resources -->
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
</project>
Here is the content of guipoc/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-project</artifactId>
<version>1.0.3</version>
</parent>
<groupId>com.mydomain.mynamespace</groupId>
<artifactId>guipoc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GuiPoc Metaproject</name>
<properties>
<playn.version>1.0.3</playn.version>
</properties>
<modules>
<module>core</module>
<module>java</module>
<module>html</module>
<module>android</module>
</modules>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>C:\Program Files\Java\jdk1.7.0_02\lib\tools.jar</systemPath>
</dependency>
</dependencies>
</project>
Unfortunately, Maven is not too smart about multimodule projects. A standard PlayN project (including yours) has the following module structure:
top
+- core
+- html (depends on core)
+- java (depends on core)
+- android, flash, etc.
When you are in the top directory, and you invoke Maven, it reads all of the submodule POMs and "knows" about all of them and will properly set up classpaths so that they see the appropriate classes directory when compiling and running.
But if you go into, say, the html directory and invoke Maven there, it no longer "knows" about all of the submodules. All it knows about is the html POM and when it sees a dependency for anything else (like the core module in this case) it goes through the standard dependency resolution process, which is:
Check the local Maven repository ~/.m2/repository.
Check the repositories explicitly specified in the POMs.
Check Maven Central.
When you have a situation where you want to run a command in one of your submodule projects, you have to arrange to do it from the top-level project. This is why testing from the command line involves running mvn test -P test-java or mvn test -P test-html from the top-level directory, rather than just cd-ing into the java or html directory and running mvn test.
Unfortunately, the tricks that we use to make it possible to test the Java or HTML submodule from the command line don't work with gae:run. So in this case, you have to work around Maven's limitations by first installing your project artifacts into your local Maven repository before invoking gae:run (and indeed, doing this every time you want to test using gae:run. This is accomplished like so:
cd top
mvn install
cd html
mvn gae:run
It would be great if Maven were smart enough to detect that it was being run in a submodule directory and automatically resolve sibling dependencies in the same way it would if you invoked Maven from the top-level project directory. Alas, smart is an adjective that's rarely applicable when talking about Maven.

Resources