Liquibase : Cannot find base path 'src/main/resources/com/example/database/changelog/v000/master.xml' - database

I am trying to build a liquibase project using maven pluging, but facing some problem using the relativeFile paths, I tried to be near to the best practices defined for liquibase maven project. when I run the mvn liquibase:update, I am getting "Cannont find base path".
src/
`-- main
|-- java
`-- resources
|-- changelog-1.0.0.xml
|-- changelog-1.1.0.xml
|-- changelog-install.xml
|-- com
| `-- obolus
| `-- database
| `-- changelog
| |-- v000
| | |-- cst
| | | |-- entity_extra_data.xml
| | | `-- entity.xml
| | |-- master.xml
| | `-- tab
| | |-- company.xml
| | |-- entity_extra_data.xml
| | |-- entity.xml
| | `-- anothertable.xml
| `-- v001
| |-- master.xml
| `-- tab
| `-- sample.xml
|-- lib
| |-- ojdbc6-11.2.0.3.jar
`-- liquibase.properties
Content of my 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.obolus</groupId>
<artifactId>database</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.maven.plugin}</version>
<configuration>
<changeLogFile>src/main/resources/changelog-install.xml</changeLogFile>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
<logging>${logLevel}</logging>
</configuration>
<executions>
<execution>
<goals>
<goal>status</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<!-- resource filtering -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>${ojdbc.driver.version}</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<ojdbc.driver.version>11.2.0.3</ojdbc.driver.version>
<liquibase.maven.plugin>3.3.2</liquibase.maven.plugin>
<logLevel>severe</logLevel>
</properties>
</project>
When i run liquibase:update, i get the following error
DEBUG 4/29/15 4:02 PM: liquibase: Using file opener for includeAll: liquibase.resource.CompositeResourceAccessor(org.liquibase.maven.plugins.MavenResourceAccessor(file:/home/www-data/workspace/database/target/classes/,file:/home/www-data/workspace/database/target/test-classes/,file:/home/www-data/.m2/repository/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar),liquibase.resource.FileSystemResourceAccessor(/home/www-data/workspace/database))
DEBUG 4/29/15 4:02 PM: liquibase: Release Database Lock
DEBUG 4/29/15 4:02 PM: liquibase: Executing UPDATE database command: UPDATE DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
INFO 4/29/15 4:02 PM: liquibase: Successfully released change log lock
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.111 s
[INFO] Finished at: 2015-04-29T16:02:15+10:00
[INFO] Final Memory: 10M/164M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.3.2:update (default-cli) on project database: Error setting up or running Liquibase: liquibase.exception.SetupException: liquibase.exception.SetupException: liquibase.exception.SetupException: Cannot find base path 'src/main/resources/com/example/database/changelog/v000/master.xml' -> [Help 1]
Any idea where I am wrong.

It seems to be working after following changes.
Change in pom.xml
<changeLogFile>target/classes/changelog-install.xml</changeLogFile
<propertyFile>target/classes/liquibase.properties</propertyFile>
Change in com.obolus.database.changelog.v000/master.xml
<includeAll path="com/obolus/database/changelog/v000/tab"/>
<includeAll path="com/obolus/database/changelog/v000/cst"/>

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>

NoClassDefFoundError: OsgiDefaultCamelContext using Apache ServiceMix

I created simple bundle:
public class Activator implements BundleActivator {
private CamelContext camelContext;
private CsvDataFormat csv = new CsvDataFormat();
public void start(BundleContext bundleContext) throws Exception {
csv.setDelimiter('|');
csv.setQuoteDisabled(true);
camelContext = new OsgiDefaultCamelContext(bundleContext);
camelContext.addRoutes(new RouteBuilder() {
#Override
public void configure() throws Exception {
from("file://./in/csv?charset=windows-1251")
.unmarshal(csv)
.process(exchange -> {
//do smth
});
}
});
camelContext.start();
}
public void stop(BundleContext bundleContext) throws Exception {
camelContext.stop();
}
}
I using Apache ServiceMix. I install bundles:
karaf#root>feature:install camel-csv
karaf#root>bundle:install -s mvn:org.apache.camel/camel-core-osgi/2.16.5
But, when I start my bundle, I have error:
Caused by: java.lang.NoClassDefFoundError: org/apache/camel/core/osgi/OsgiDefaultCamelContext
at ru.camel.csv.Activator.start(Activator.java:19)
But why? In karaf console I see:
222 | Active | 50 | 2.16.5 | camel-csv
223 | Active | 50 | 1.1.0 | Apache Commons CSV
224 | Resolved | 80 | 1.0.0.SNAPSHOT | csv
228 | Active | 80 | 2.16.5 | camel-core-osgi
Bundle camel-core-osgi contains class OsgiDefaultCamelContext. Why I get this error?
My 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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ru.camel</artifactId>
<groupId>ru.camel.test</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>csv</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-osgi</artifactId>
<version>2.16.5</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-csv</artifactId>
<version>2.16.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>osgi-bundle</id>
<goals>
<goal>bundle</goal>
</goals>
<phase>package</phase>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>org.apache.camel.core.osgi.OsgiDefaultCamelContext</Import-Package>
<Bundle-Activator>ru.camel.csv.Activator</Bundle-Activator>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
You should check the imports of your bundle.
Every bundle has to declare which packages (classes) it wants to import. Your bundle probably did not declare to import the package OsgiDefaultCamelContext is in.
Imports are defined in the META-INF/MANIFEST.MF of your bundle. Depending on your build tool this file might be created automatically during the build. Otherwise, you have to write that yourself, although I would highly recommend looking at a tool that does this automatically during the build.
In your pom.xmlchange the configuration of the Import-Package statement of the maven-bundle-plugin to:
<Import-Package>org.apache.camel.core.osgi.*;*</Import-Package>

Maven JAR plugin skipping generated-resources folder

I am facing a strange issue while trying to run a simple AngularJS Spring Boot project (after sorting out the issues mentioned in this thread). Following is my Maven POM. The issue I am facing is that while the Wro4j plugin is able to generate the JS/CSS files under generated-resources, and despite that under build/resources I have provided the paths to be packaged, the files under generated-resources are not getting packaged within the JAR under "static" folder (only my custom JS file and the index.html file appear there). How could this be corrected?
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-angularjs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.test</groupId>
<artifactId>my-microservice-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wro4j.version>1.8.0</wro4j.version>
<java.version>1.8</java.version>
<bootstrap.version>3.3.7-1</bootstrap.version>
<angularjs.version>1.5.9</angularjs.version>
<jquery.version>3.1.1-1</jquery.version>
</properties>
<dependencies>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>${angularjs.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jasmine</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<!-- Serves *only* to filter the wro.xml so it can get an absolute
path for the project -->
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/wro</outputDirectory>
<resources>
<resource>
<directory>src/main/wro</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<cssDestinationFolder>${project.build.directory}/generated-resources/static/css</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/generated-resources/static/js</jsDestinationFolder>
<wroFile>${project.build.directory}/wro/wro.xml</wroFile>
<!--
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
<contextFolder>${basedir}/src/main/wro</contextFolder>
-->
<extraConfigFile>${project.build.directory}/wro/wro.properties</extraConfigFile>
<contextFolder>${project.build.directory}/wro</contextFolder>
</configuration>
<dependencies>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${jquery.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>${angularjs.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>${angularjs.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Following is the Maven build log (for mvn clean package):
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-angularjs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # spring-angularjs ---
[INFO] Deleting C:\projects\spring-angularjs\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:copy-resources (copy-resources) # spring-angularjs ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # spring-angularjs ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\projects\spring-angularjs\target\generated-resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # spring-angularjs ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\projects\spring-angularjs\target\classes
[INFO]
[INFO] --- wro4j-maven-plugin:1.8.0:run (default) # spring-angularjs ---
[INFO] C:\projects\spring-angularjs\target/wro
[INFO] Executing the mojo:
[INFO] Wro4j Model path: C:\projects\spring-angularjs\target\wro\wro.xml
[INFO] targetGroups: null
[INFO] minimize: true
[INFO] ignoreMissingResources: null
[INFO] parallelProcessing: false
[INFO] buildDirectory: C:\projects\spring-angularjs\target
[INFO] destinationFolder: C:\projects\spring-angularjs\target
[INFO] jsDestinationFolder: C:\projects\spring-angularjs\target\generated-resources\static\js
[INFO] cssDestinationFolder: C:\projects\spring-angularjs\target\generated-resources\static\css
[INFO] The following groups will be processed: [angular-bootstrap]
[INFO] folder: C:\projects\spring-angularjs\target\generated-resources\static\css
[INFO] processing group: angular-bootstrap.css
[WARNING] Less warnings are:
[WARNING] 10:1 Cannot link source map. Css result location is not know and could not be deduced from input less source..
[INFO] file size: angular-bootstrap.css -> 145074 bytes
[INFO] C:\projects\spring-angularjs\target\generated-resources\static\css\angular-bootstrap.css (145074 bytes)
[INFO] folder: C:\projects\spring-angularjs\target\generated-resources\static\js
[INFO] processing group: angular-bootstrap.js
[INFO] file size: angular-bootstrap.js -> 254638 bytes
[INFO] C:\projects\spring-angularjs\target\generated-resources\static\js\angular-bootstrap.js (254638 bytes)
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # spring-angularjs ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\projects\spring-angularjs\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # spring-angularjs ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # spring-angularjs ---
[INFO] No tests to run.
[INFO]
[INFO] --- jasmine-maven-plugin:2.0:test (default) # spring-angularjs ---
[INFO] jetty-8.1.14.v20131031
[INFO] Started SelectChannelConnector#0.0.0.0:60402
[INFO] Executing Jasmine Specs
[INFO] Resolved artifact C:\Users\XXXXX\.m2\repository\com\github\klieber\phantomjs\2.0.0\phantomjs-2.0.0-windows.zip from remote-repos-vr (https://vrartifactory.eficode.com/remote-repos-vr, default, releases+snapshots)
[INFO] Extracting C:\Users\XXXXX\.m2\repository\com\github\klieber\phantomjs\2.0.0\phantomjs-2.0.0-windows.zip\phantomjs-2.0.0-windows\bin\phantomjs.exe to C:\projects\spring-angularjs\target\phantomjs\phantomjs-2.0.0-windows\bin\phantomjs.exe
[INFO]
-------------------------------------------------------
J A S M I N E S P E C S
-------------------------------------------------------
[INFO]
Results: 0 specs, 0 failures, 0 pending
[INFO] stopped o.e.j.s.h.ContextHandler{/webjars,file:/C:/projects/spring-angularjs/}
[INFO] stopped o.e.j.s.h.ContextHandler{/classpath,file:/C:/projects/spring-angularjs/}
[INFO] stopped o.e.j.s.h.ContextHandler{/,file:/C:/projects/spring-angularjs/}
[INFO] stopped o.e.j.s.h.ContextHandler{/spec,file:/C:/projects/spring-angularjs/}
[INFO] stopped o.e.j.s.h.ContextHandler{/src,file:/C:/projects/spring-angularjs/}
[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) # spring-angularjs ---
[INFO] Building jar: C:\projects\spring-angularjs\target\spring-angularjs-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.8.RELEASE:repackage (default) # spring-angularjs ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.848 s
[INFO] Finished at: 2017-11-09T16:04:39+05:30
[INFO] Final Memory: 98M/503M
[INFO] ------------------------------------------------------------------------
wro4j-maven-plugin:run is running at compile phase, after the process-resources phases where all resources are copied to ${project.build.outputDirectory} (by default target/classes). Only files from this folder are included into your JAR, but your CSS/JS files are generated after Maven tried to copy them to the outputDirectory, thus never being added.
You simply have to configure Wro4j plugin to run during generate-resources phase:
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
...
</plugin>
If for some reasons your files cannot be generated before compile (maybe it requires your code to be compiled), you'll have instead to manually add your resources into your project build output directory with the Maven Resources Plugin after they are generated as you did in your comment - though I would recommend doing it during the prepare-package phase using ${project.build.outputDirectory} such as:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<execution>
<id>copy-resources-post-compile</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDir‌​ector‌​y>
<resources>
<resource>
<directory>${project.build.directory}/generated-res‌​ources</directory>
</resource>
</resources>
</configuration>
</execution>
</plugin>
EDIT: To learn more about the Maven lifecycle, phases and goals, see Intro to Build Lifecycle and this tutorial explains things well. Also take a look at the default bindings to see which plugins are run by default depending on your packaging.

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.

Resources