Creating a single camel application bundle with all dependencies using maven3 - apache-camel

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.

Related

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

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>

pmd jenkins plugin error class is missing: org/apache/maven/reporting/AbstractMavenReport

Please help me, i try to execute pmd report from jenkins but, i have a build error
for execution, my goal:
When I run mvn clean install pmd:pmd, from the project folder it's build error Does anyone get this error?
My project Pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.1</version>
</dependency>
</dependencies>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<encoding>UTF-8</encoding>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<verbose>false</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>resources</goal>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
i added this, Jenkins plugins,
Maven Integration plugin- 2.17
PMD Plugin- 3.49
Static Analysis Utilities- 1.92
ERROR:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.8:pmd (default-cli) on project SINGLE_HUB_POM: Execution default-cli of goal org.apache.maven.plugins:maven-pmd-plugin:3.8:pmd failed: Unable to load the mojo 'pmd' in the plugin 'org.apache.maven.plugins:maven-pmd-plugin:3.8'. A required class is missing: org/apache/maven/reporting/AbstractMavenReport
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-pmd-plugin:3.8
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/.m2/org/apache/maven/plugins/maven-pmd-plugin/3.8/maven-pmd-plugin-3.8.jar
[ERROR] urls[1] = file:/home/.m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.maven.reporting.AbstractMavenReport
[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
mvn clean compile package assembly:assembly install try this

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>

Unable to Deploy Allure report on Jetty server

I am trying to deploy allure report which was generated after "mvn clean test site". I have used mvn jetty:run and when I tried to open "http://localhost:8080", I got a "Directory:/" as a text in firefox browser instead of actual Allure report.
Output of jetty server
Error Section
No Error
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.mycomp</groupId>
<artifactId>AllureWebDriverMvnProj</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<allure.version>1.5.0-RC1</allure.version>
<aspectj.version>1.8.7</aspectj.version>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.9</version>
</dependency>
<dependency>
<groupId>ru.stqa.selenium</groupId>
<artifactId>webdriver-factory</artifactId>
<version>1.1.46</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/target/site</directory>
<directory>${basedir}/target/allure-results</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
<suiteXmlFile>src/test/resources/testng_demo.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.11.v20150529</version>
<configuration>
<configuration>
<webAppSourceDirectory>../AllureWebDriverMvnProj/target/site/allure-maven-plugin/</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
<!-- profiles -->
<profiles>
<!-- browsers -->
<profile>
<id>firefox</id>
<properties>
<capabilities>/firefox.capabilities</capabilities>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>chrome</id>
<properties>
<capabilities>/chrome.capabilities</capabilities>
</properties>
</profile>
<profile>
<id>ie</id>
<properties>
<capabilities>/ie.capabilities</capabilities>
</properties>
</profile>
<profile>
<id>safari</id>
<properties>
<capabilities>/safari.capabilities</capabilities>
</properties>
</profile>
<profile>
<id>phantomjs</id>
<properties>
<capabilities>/phantomjs.capabilities</capabilities>
</properties>
</profile>
<profile>
<id>opera</id>
<properties>
<capabilities>/opera.capabilities</capabilities>
</properties>
</profile>
<profile>
<id>htmlunit</id>
<properties>
<capabilities>/htmlunit.capabilities</capabilities>
</properties>
</profile>
<!-- environments -->
<profile>
<id>localhost</id>
<properties>
<site.url>http://localhost/</site.url>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>devhost</id>
<properties>
<site.url>http://devhost/</site.url>
</properties>
</profile>
<profile>
<id>testhost</id>
<properties>
<site.url>http://testhost/</site.url>
</properties>
</profile>
<profile>
<id>prodhost</id>
<properties>
<site.url>http://prodhost.com/</site.url>
</properties>
</profile>
<!-- grid -->
<profile>
<id>nogrid</id>
<properties>
<grid.url></grid.url>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>grid</id>
<properties>
<grid.url>http://localhost:4444/wd/hub/</grid.url>
</properties>
</profile>
</profiles>
</project>
Console Output
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AllureWebDriverMvnProj 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.2.11.v20150529:run (default-cli) # AllureWebDriverMvnProj >>>
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # AllureWebDriverMvnProj ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # AllureWebDriverMvnProj ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # AllureWebDriverMvnProj ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # AllureWebDriverMvnProj ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< jetty-maven-plugin:9.2.11.v20150529:run (default-cli) # AllureWebDriverMvnProj <<<
[INFO]
[INFO] --- jetty-maven-plugin:9.2.11.v20150529:run (default-cli) # AllureWebDriverMvnProj ---
2015-11-10 13:38:35.132:INFO::main: Logging initialized #9160ms
[INFO] Configuring Jetty for project: AllureWebDriverMvnProj
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] webAppSourceDirectory E:\Selenium\eclipse-jee-luna-SR2-win32\Luna_Workspace_new\AllureWebDriverMvnProj\src\main\webapp does not exist. Trying E:\Selenium\eclipse-jee-luna-SR2-win32\Luna_Workspace_new\AllureWebDriverMvnProj\target\webapp-tmp
[INFO] Reload Mechanic: automatic
[INFO] Classes = E:\Selenium\eclipse-jee-luna-SR2-win32\Luna_Workspace_new\AllureWebDriverMvnProj\target\classes
[INFO] Context path = /
[INFO] Tmp directory = E:\Selenium\eclipse-jee-luna-SR2-win32\Luna_Workspace_new\AllureWebDriverMvnProj\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = null
[INFO] Webapp directory = E:\Selenium\eclipse-jee-luna-SR2-win32\Luna_Workspace_new\AllureWebDriverMvnProj\target\webapp-tmp
2015-11-10 13:38:35.337:INFO:oejs.Server:main: jetty-9.2.11.v20150529
2015-11-10 13:38:42.450:INFO:oejsh.ContextHandler:main: Started o.e.j.m.p.JettyWebAppContext#7d29df{/,file:/E:/Selenium/eclipse-jee-luna-SR2-win32/Luna_Workspace_new/AllureWebDriverMvnProj/target/webapp-tmp/,AVAILABLE}{file:/E:/Selenium/eclipse-jee-luna-SR2-win32/Luna_Workspace_new/AllureWebDriverMvnProj/target/webapp-tmp/}
2015-11-10 13:38:42.466:WARN:oejsh.RequestLogHandler:main: !RequestLog
2015-11-10 13:38:42.592:INFO:oejs.ServerConnector:main: Started ServerConnector#5cd81a{HTTP/1.1}{0.0.0.0:8080}[INFO] Started Jetty Server
2015-11-10 13:38:42.592:INFO:oejs.Server:main: Started #16620ms
In maven test and site are different phases.
You should run maven commands in two steps:
1. mvn clean test
2. mvn site
Then you will get generated Allure report
#Illia B, Thanks for the reply. We can mention "site" along with the "clean test". Its gonna work smoothly. The issue was with the configuration tag (By mistakenly I mentioned it twice) and the webAppSourceDirectory tag was pointing at wrong directory.
I targeted it to the right path and it worked.

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.

Resources