this is not a camel question and actually it has nothing to do with camel.

you need to look at the maven jar archive plugin documentation.
http://maven.apache.org/shared/maven-archiver/

in your case, take a look at how the Class-Path header in the manifest
file of your jar looks like. You probably have wrong values.

usually you will need to add a few properties (e.g., classpathLayout,
classpathPrefix) in the plugin configuration so that the each path
segment represents a valid class path.

for example, if you want your jar to load dependent jars from your
repo, you can add
      <classpathLayoutType>repository</classpathLayoutType>
      <classpathPrefix>${settings.localRepository}</classpathPrefix>

and run the build and verify the manifest entry of your generated jar.

regards, aki


2014-07-18 11:03 GMT+02:00 sergarci <[email protected]>:
> I've ended using spring-boot:
>
> /<plugin>
>    <groupId>org.springframework.boot</groupId>
>    <artifactId>spring-boot-maven-plugin</artifactId>
>    <version>1.1.4.RELEASE</version>
>    <executions>
>          <execution>
>               <goals>
>                 <goal>repackage</goal>
>                </goals>
>           </execution>
>      </executions>
> </plugin>/
>
> With a custom main class:
>
> /import org.apache.camel.spring.Main;
>
> public class CamelMain {
>     public static void main(String[] args) throws Exception {
>         Main main = new Main();
>         main.setApplicationContextUri("spring/camel-context.xml");
>         main.enableHangupSupport();
>         main.start();
>         while (true);
>     }
> }/
>
> just running *mvn package* and generated jar file works as if running mvn
> camel:run.
>
> Thanks everyone
>
> Used resources:
> camel in action book
> http://docs.spring.io/spring-boot/docs/1.0.1.RELEASE/reference/html/build-tool-plugins-maven-plugin.html
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Package-camel-spring-into-jar-file-tp5753964p5753993.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to