Camel: Unresolved dependency exception for Camel Component - java

I am creating a Maven based Camel Component. I have added relevant dependencies in POM.xml but still I get below exception:
Unresolved dependency: (&(component=FileFormatConversion)(objectClass=org.apache.camel.spi.ComponentResolver))
I was able to build & run the Maven project. My component jar is however present in the component Folder:
Component Folder
Can anyone advise if there is some issue with my POM or the reason behind this exception. Here is my POM.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FileFormatConversion</groupId>
<artifactId>FileFormatConversion</artifactId>
<version>1.0.0</version>
<packaging>bundle</packaging>
<name>${project.groupId}.${project.artifactId}</name>
<properties>
<camel.version>2.18.0</camel.version>
<import.packages>*;version="0";resolution:=optional</import.packages>
<private.packages>!*</private.packages>
<symbolic.name>${project.groupId}</symbolic.name>
<embed-dep>*;scope=compile;type=!pom;inline=true</embed-dep>
<unpack-bundle>false</unpack-bundle>
<maven.test.skip>true</maven.test.skip>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
</properties>
<dependencies>
<!-- Check for the latest version of this artifact in central maven repository -->
<dependency>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<version>1.24.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-component -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-component</artifactId>
<version>1.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/in.jlibs/jlibs-xsd -->
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-xsd</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-xml</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-visitor</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-core</artifactId>
<version>2.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache/xerces -->
<dependency>
<groupId>org.apache</groupId>
<artifactId>xerces</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>4.2.0</version>
<inherited>true</inherited>
<configuration>
<excludeDependencies>true</excludeDependencies>
<instructions>
<Include-Resource>src/main/resources/,lib/</Include-Resource>
<Bundle-SymbolicName>${symbolic.name}</Bundle-SymbolicName>
<Bundle-Classpath>.,jax-qname.jar,jaxmexs-0.5.jar,xsd-2.2.3.jar,jlibs-core-2.2.1.jar,jlibs-visitor-2.2.1.jar,jlibs-xml-2.2.1.jar,
jlibs-xsd-2.2.1.jar,xercesImpl-2.11.0.jar,xml-apis-1.4.01.jar,FileFormatConversion-1.0.0.jar
</Bundle-Classpath>
<Import-Package>${import.packages}</Import-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTransitive>true</excludeTransitive>
<!-- Specify the artifacts to be excluded in the dependencies -->
<excludeArtifactIds></excludeArtifactIds>
<!-- Specify the group ids to be excluded in the dependencies -->
<excludeGroupIds>com.sap.cloud.adk,org.apache.camel,org.slf4j,log4j,in.jlibs,xerces,org.apache</excludeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<version>1.24.0</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<executions>
<execution>
<id>build-adapter</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<adapterProjectDirectory>${project.basedir}</adapterProjectDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

What is this?
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-component</artifactId>
<version>1.4.0</version>
</dependency>
That does not look correct as its some old stuff from Camel 1.x. You should remove that.
And you need to tell more how you run this? It seems like you use OSGi/Karaf or something. But take a look at how any of the existing components as an example to build custom components, or the Camel Maven archetype for component.

I resolved the issue myself. The Problem was in below Statement:
${import.packages}

Related

jacoco-maven-plugin:0.7.9 dependency issue

I was trying to add jacoco maven plugin in my pom.xml file but getting below error while building the project.
Execution default-prepare-agent of goal org.jacoco:jacoco-maven-plugin:0.7.9:prepare-agent failed: Plugin org.jacoco:jacoco-maven-plugin:0.7.9 or one of its dependencies could not be resolved: The following artifacts could not be resolved: commons-codec:commons-codec:jar:1.2,
commons-collections:commons-collections:jar:3.2: Could not transfer artifact commons-codec:commons-codec:jar:1.2 from/to central (https://artifactory.corp.chartercom.com/plugins-release):
Access denied to https://artifactory.corp.chartercom.com/plugins-release/commons-codec/commons-codec/1.2/commons-codec-1.2.jar. Error code 403, Forbidden
I have tried a couple of things as mentioned below:
I have tried to upgrate jacoco version for 0.7.9 to 0.8.4, 0.8.5 and 0.8.6 and try to exclude commons-codec:commons-codec:jar:1.2 and commons-collections:commons-collections:jar:3.2 jar form jacoco plugin but it doesn't work.
I have also tried to add upgraded dependencies of commons-codec and commons-collections jars in my pom.xml but it doesn't work.
here is my pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 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.3.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.charter.ews.location</groupId>
<artifactId>search-address-api</artifactId>
<version>0.0.9-SNAPSHOT</version>
<name>search-address-api</name>
<properties>
<java.version>1.8</java.version>
<charter.logging>1.2</charter.logging>
<charter.error>1.1</charter.error>
<charter.transactionalizer>1.2</charter.transactionalizer>
<swagger.version>2.7.0</swagger.version>
<charter.algorithm.lib>1.0.0.RELEASE</charter.algorithm.lib>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</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>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- Charter dependencies -->
<dependency>
<groupId>com.charter.web.services</groupId>
<artifactId>transactionalizer</artifactId>
<version>${charter.transactionalizer}</version>
</dependency>
<dependency>
<groupId>com.charter.logging</groupId>
<artifactId>charter-logging</artifactId>
<version>${charter.logging}</version>
</dependency>
<dependency>
<groupId>com.charter.error</groupId>
<artifactId>charter-error</artifactId>
<version>${charter.error}</version>
</dependency>
<!-- junit -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/com/charter/address/model/*</exclude>
<exclude>**/com/charter/address/config/*</exclude>
<exclude>**/com/charter/address/exception/*</exclude>
<exclude>**/com/charter/address/constants/*</exclude>
<exclude>**/com/charter/address/Application.class</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin> <!-- Copy configuration files to a location accessible by Helm. Use mvn resources:copy-resources
for execution -->
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>chart/files</outputDirectory>
<resources>
<resource>
<directory>config</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.yaml</include>
<include>**/logback*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <!-- Helper to 1) change SNAPSHOT to RELEASE. 2) Frame Docker image name -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<name>newVersion</name>
<value>${project.version}</value>
<regex>-SNAPSHOT|-build\.(.*)|-build</regex>
<replacement>-build.${BUILD_NUMBER}</replacement>
<failIfNoMatch>false</failIfNoMatch>
<source />
<fileSet />
</configuration>
</plugin>
</plugins>
</build>
Is this error has anything to do with setting.xml file ? your suggestions will be highly appriciated.
Instead of commons-collections4, You can try adding commons-collections dependency as shown below.
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
or you can directly give commons-collections dependency in jacoco plugin as shown below.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/com/charter/address/model/*</exclude>
<exclude>**/com/charter/address/config/*</exclude>
<exclude>**/com/charter/address/exception/*</exclude>
<exclude>**/com/charter/address/constants/*</exclude>
<exclude>**/com/charter/address/Application.class</exclude>
</excludes>
</configuration>
</plugin>

Netbeans Linux : Mojo failure

I've a problem with my netbeans project on linux ( running on kali linux ).
Even if the build (without run) works , i cant run my project and i've this error :
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project covoiturage: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec are missing or invalid -> [Help 1]
Here is my pom :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ig2i.centralelille</groupId>
<artifactId>covoiturage</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>covoiturage</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>ig2i.centralelille.covoiturage.MainApp</mainClass>
</properties>
<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>Your Organisation</name>
</organization>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeScope>system</excludeScope>
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<encoding>utf8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.asm</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.antlr</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</project>
I tried to create a new project but it seems that the problem comes from netbeans configuration .
Could you help me please ?
Thank you in advance !
It seems as if the maven exec plugin is not well configured.
Have a look at the documentation: The plugin offers two goals exec and java
I am using the plugin with exec:java (run in same jvm) and you need to configure the MainClass like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>your.context.MainClass</mainClass>
</configuration>
</plugin>
On the other case (exec:exec) you should specify the executable as described in the specification / sample

Google Cloud Storage Runtime Error

I'm simply trying to list the contents of my Google Cloud Storage bucket from my GAE (java) using the following code:
GcsService gcsService = GcsServiceFactory.createGcsService(new RetryParams.Builder()
.initialRetryDelayMillis(10)
.retryMaxAttempts(10)
.totalRetryPeriodMillis(15000)
.build());
try{
ListResult list = gcsService.list("MyTestBucket", new ListOptions.Builder().setPrefix("testFolder").setRecursive(true).build());
}
It compiles, but when I run it I get the following error which I don't understand:
Caused by: java.lang.NoSuchMethodError: com.google.appengine.tools.cloudstorage.GcsService.list(Ljava/lang/String;Lcom/google/appengine/tools/cloudstorage/ListOptions;)Lcom/google/appengine/tools/cloudstorage/ListResult;
The POM dependency looks like this to include Google Storage:
<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.6</version>
</dependency>
I've tried various <exclusions> but can't seem to make it work.
Thanks
Tim
POM File:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<version>1.0</version>
<groupId>com.xyz.abc</groupId>
<artifactId>xyzclienttest</artifactId>
<properties>
<appengine.app.version>1</appengine.app.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.54</version>
</dependency>
<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.6</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>5.1.5</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>javax.jdo</groupId>
<artifactId>jdo-api</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.github.mpkorstanje</groupId>
<artifactId>simmetrics-core</artifactId>
<version>3.2.3</version>
</dependency>
</dependencies>
<build> <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.54</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<!-- Comment in the below snippet to bind to all IPs instead of just localhost -->
<!-- address>0.0.0.0</address>
<port>8080</port -->
<!-- Comment in the below snippet to enable local debugging with a remove debugger
like those included with Eclipse or IntelliJ -->
<!-- jvmFlags>
<jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags -->
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<!--
Enables analysis which takes more memory but finds more bugs.
If you run out of memory, changes the value of the effort element
to 'low'.
-->
<effort>Max</effort>
<!-- Reports all bugs (other values are medium and max) -->
<threshold>Low</threshold>
<onlyAnalyze>com.xyz.abc.*,com.xyz.abc.util.*</onlyAnalyze>
<!-- Produces XML report -->
<xmlOutput>true</xmlOutput>
<xmlOutputDirectory>target/site</xmlOutputDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
Fixed it! I looked in the .war file and found that there were two versions of the appengine-gcs-client jar files. 0.2 and 0.6. I did an mvn clean and it sorted the problem. I really should have done that before :-( Live and learn!
Try removing <enableJarClasses>false</enableJarClasses>. I suspect this is causing the JAR for the GCS library not be be included in the artifact ran on GAE. As a result required classes might be missing.

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec cannot run program "raml2html"

I am getting maven error even though i tried doing "maven clean install" and then "maven build" after that. The error that i am getting is when i tried doing "Maven Build". I have already installed npm and raml2html locally but not sure what is wrong here. The error that i am getting is -
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (default) on project archival-system: Command execution failed. Cannot run program "raml2html" (in directory ""): error=2, No such file or directory -> [Help 1]
Below is my POM.XML:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.project</groupId>
<artifactId>archival</artifactId>
<version>1.0</version>
<name>Archival System</name>
<description>Archival for all services</description>
<properties>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<fabric8.version>2.2.144</fabric8.version>
<app-main-class>com.project.AppInit</app-main-class>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<fabric8.maven.plugin.version>3.0.31</fabric8.maven.plugin.version>
<exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
<camel.version>2.17.3</camel.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<weld.version>2.3.3.Final</weld.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-project-bom-with-platform-deps</artifactId>
<version>${fabric8.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-parent</artifactId>
<version>${camel.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>com.commons</groupId>
<artifactId>common-startup</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.commons</groupId>
<artifactId>member-pick-commons</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.4</version>
</dependency>
<dependency>
<groupId>com.commons</groupId>
<artifactId>pw</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.commons</groupId>
<artifactId>common-util</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.commons</groupId>
<artifactId>database-commons</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.1.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/de.androbit/raml-converter-maven-plugin -->
<dependency>
<groupId>de.androbit</groupId>
<artifactId>raml-converter-maven-plugin</artifactId>
<version>0.15</version>
</dependency>
<!-- <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-dozer</artifactId>
</dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.1.7</version> </dependency> -->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<configuration>
<mainClass>${app-main-class}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>raml2html</executable>
<commandlineArgs>-i src/docs/api.raml -o target/api.html</commandlineArgs>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>hawt-app-maven-plugin</artifactId>
<version>${fabric8.version}</version>
<executions>
<execution>
<id>hawt-app</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<javaMainClass>${app-main-class}</javaMainClass>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/hawt-app/route</outputDirectory>
<resources>
<resource>
<directory>route</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Any help is appreciated.

How to implement push-style RESTful webservice with Apache CXF?

We already use Apache CXF in our project and I wondering if it is possible to implement push RESTful service (the feature introduced with Servlet 3.0 spec) within CXF 2.7?
Yes..... Download cxf-3.0.0 framework zip( here is the link). on extracting you can find samples directory(number of sample cxf projects are there for our reference). In our case select jax_rs/websocket directory. You can find sample push customer maven project. I modified the existing pom.xml as below and imported to eclipse and worked perfectly.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cxf.sample</groupId>
<artifactId>jax_rs_websocket</artifactId>
<version>3.0.0</version>
<name>JAX-RS WebSocket Demo</name>
<description>JAX-RS WebSocket Demo</description>
<properties>
<cxf.version>3.0.0</cxf.version>
<cxf.ahc.version>1.8.1</cxf.ahc.version>
<cxf.jetty.version>8.1.14.v20131031</cxf.jetty.version>
<cxf.netty3.version>3.8.0.Final</cxf.netty3.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>server</id>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>demo.jaxrs.server.Server</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>client</id>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>demo.jaxrs.client.Client</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.0.0</version>
</dependency>
<!-- This dependency is needed if you're using the Jetty container -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-websocket</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>${cxf.jetty.version}</version>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>${cxf.ahc.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>${cxf.netty3.version}</version>
</dependency>
<!-- JettyHttpDestination is referring to org.springframework.util.ClassUtils -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.0.3.RELEASE</version>
</dependency>
</dependencies>
</project>

Categories

Resources