camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <bibr...@gmail.com>
Subject Re: Spring DSL route
Date Tue, 21 Feb 2012 23:55:43 GMT
Camel has org.apache.camel.spring.Main class that will load the spring
context and start Camel routes. In order to use it, you have to add it to
the jar manifest:

- If you are copying the dependencies manually as in your example then you
only have to add this in your pom:

  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>

<mainClass>org.apache.camel.spring.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>


- if you prefer maven to include all the dependencies in the jar file then
you can add  this to your pom:



            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>org.apache.camel.spring.Main</mainClass>
                    </manifest>

                </archive>

                </configuration>
            </plugin>


After that you should be able to run the jar file

HTH
Bilgin


On 21 February 2012 22:15, newbiee <m_essa24@hotmail.com> wrote:

> If I define my route using JAVA DSL and then if I want to run my program
> from
> a different computer where maven does not exist, I can do the following:
>
>
>  java -cp dependency/*;chapter1-file-copy-1.0.jar
> camelinaction.FileCopierWithCamel
>
> Here my route is in "FileCopierWithCamel"
>
> My question is: If my route is defined using Spring DSL i.e.
> "camel-context.xml" then how can I execute the route from a different
> computer where maven does not exist.
>
> 1. I will have to copy all the dependencies using the following commmand:
>
>            mvn dependency:copy-dependencies
>
> 2. Following commad will create JAR file:
>
>             mvn install
>
> Now what should I do to run the program from a different computer?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Spring-DSL-route-tp5503528p5503528.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message