Hi Pedro,

Assuming you're using maven3, you can use the interactive create archetype process:

 $ mvn archetype:generate -Dfilter=org.apache.camel.archetype:

This will allow you to pick the type of camel project you want to create, the version of camel you're using and set the group, artifact, and version for your project. After that you can change into the directory of your new project and run either:

  $ mvn eclipse:eclipse

if you're using Eclipse as an IDE, or:

  $ mvn idea:idea

if you're using IntelliJ. If you're using something else, then these commands won't be particularly helpful.

This should be a pretty decent start to get a compilable/working camel project. I would also avoid copying folders from one maven project to another unless you're absolutely sure they are not involved in any of maven's phases because your pom file likely isn't set up to handle them.

Also, Claus has written an excellent book, "Camel in Action", which is very easy to read and follow especially once you understand how to generate projects from the above archetype and deploy them to whatever container you're going to run them in. I can't recommend his book enough - it'll get you past being a beginner and make you much more competent with Camel.

I hope this helps.

John

On 11/1/13, 5:37 AM, pmp.martins wrote:
Hello all, as you can see I am quite a beginner using Camel. I am trying to
create a very basic Eclipse project using Camel and Maven but somehow I
always end up with errors and it simply doesn't seem to work.

  - I have tried copying folders from other projects and change the name but
then maven doesn't like it and it doesn't let me run anything.
  - I decided to start a new project from scratch with maven using:

mvn archetype:generate \
   -DarchetypeGroupId=org.apache.maven.archetypes \
   -DgroupId=com.mycompany.app \
   -DartifactId=my-app

  - Then tried creating a pom.xml myself, I even added the camel-core and the
slf4j dependencies manually (check out my 40 lines of pom.xml at  HERE
<http://pastebin.kde.org/p9pccinyf>  ), but I still cannot run it in eclipse
and maven is not behaving any better. t

   - Before attempting to run this example in eclipse I used the command "mvn
eclipse:eclipse". But in Eclipse IDE I get the following error:

log4j:WARN No appenders could be found for logger
(org.apache.camel.impl.DefaultCamelContext).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.

The code I am trying to run is fairly simple as well, it is from an example
I found in a book. You can check the very simple code sample  HERE
<http://pastebin.kde.org/pybxkdebe>  .

I am completely lost, nothing I do seems to be able to work, and I still
need to learn how to use Camel LoadBalancer using the failover construct.
Can any one help me and tell me how to create a basic Camel project for
dummies?

Thanks, Pedro.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-create-a-basic-camel-project-with-mvn-for-eclipse-for-dummies-tp5742489.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to