Including maven dependencies in war and ear generated by eclipse

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Including maven dependencies in war and ear generated by eclipse

Eduardo M KALINOWSKI-4
Let me explain briefly my situation: we are building a web application  
composed of a war module, a ejb module and a few jar modules. We use  
Eclipse as IDE, and there was an Eclipse project that built an ear out  
of all the modules, and it was deployed to JBoss for testing.

We decided to start using maven. I "converted" the projects to use  
maven, and I'm using m2eclipse for integration with the IDE. Besides  
those modules described above, there is also a parent pom and a new  
project with packaging type ear that creates the ear.

 From the command line, everything works fine. The ear is generated  
with all dependecies and works fine in JBoss. But we would like to  
keep using Eclipse for development.

I imported the ear project into Rclipse, and added it to the JBoss  
server configured in Eclipse. Eclipse builds the ear and copies it to  
JBoss deploy directory, but no dependencies are included in the ear.  
Neither are they included in the war that is part of the ear.  
(Naturally the application cannot run.)

I could copy the necessary .jar files into appropriate directories so  
that Eclipse finds them and bundles them in the war and ear, but that  
would defeat the purpose of using maven, wouldn't it? Is there a way  
to tell Eclipse to use the libraries listed in the pom files  
(including dependency resolution)?

In case this is relevant, we are not using the hierarchical project  
structure recommended by the maven docs. And individual projects do  
not follow the maven recommended location for sources, it was  
necessary to manually specify these locations in the poms.


--
Quack!
        Quack!! Quack!!

Eduardo M KALINOWSKI
[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Including maven dependencies in war and ear generated by eclipse

Fred Bricon
What versions of eclipse / m2eclipse are you using? Have you added the Maven Integration for WTP module?
EAR support starts to be very usable with m2e 0.9.9 dev, IMHO.
There's a couple maven archetypes you can try out to kickstart Java EE 5 development at http://code.google.com/p/open-archetypes/
Even though they use a nested layout, you can easily transform them to use a hierarchical structure. Try to create a project using maven CLI, change its structure according to your taste, then import the project in Eclipse as "maven projects"

regards,

Fred Bricon


On Mon, Feb 1, 2010 at 8:12 PM, Eduardo M KALINOWSKI <[hidden email]> wrote:
Let me explain briefly my situation: we are building a web application composed of a war module, a ejb module and a few jar modules. We use Eclipse as IDE, and there was an Eclipse project that built an ear out of all the modules, and it was deployed to JBoss for testing.

We decided to start using maven. I "converted" the projects to use maven, and I'm using m2eclipse for integration with the IDE. Besides those modules described above, there is also a parent pom and a new project with packaging type ear that creates the ear.

From the command line, everything works fine. The ear is generated with all dependecies and works fine in JBoss. But we would like to keep using Eclipse for development.

I imported the ear project into Rclipse, and added it to the JBoss server configured in Eclipse. Eclipse builds the ear and copies it to JBoss deploy directory, but no dependencies are included in the ear. Neither are they included in the war that is part of the ear. (Naturally the application cannot run.)

I could copy the necessary .jar files into appropriate directories so that Eclipse finds them and bundles them in the war and ear, but that would defeat the purpose of using maven, wouldn't it? Is there a way to tell Eclipse to use the libraries listed in the pom files (including dependency resolution)?

In case this is relevant, we are not using the hierarchical project structure recommended by the maven docs. And individual projects do not follow the maven recommended location for sources, it was necessary to manually specify these locations in the poms.


--
Quack!
       Quack!! Quack!!

Eduardo M KALINOWSKI
[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Including maven dependencies in war and ear generated by eclipse

Eduardo M KALINOWSKI-4
On Seg, 01 Fev 2010, Fred Bricon wrote:
> What versions of eclipse / m2eclipse are you using?

It's Eclipse 3.5 and m2eclipse 0.9.8.

> Have you added the Maven Integration for WTP module?

I had not, stupid me. Just adding it did not change much, though.

> EAR support starts to be very usable with m2e 0.9.9 dev, IMHO.

Thanks for the tip, I've upgraded my version and now the ear is created
correctly.

However, the war included inside the ear is still missing some required
external libraries (the other modules of the project are included, but
things such as struts are not in the WEB-INF/lib dir). Any further tips
regarding that?


--
   I can resist everything except temptation. -Oscar Wilde

Eduardo M KALINOWSKI
[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Including maven dependencies in war and ear generated by eclipse

Fred Bricon
Eduardo,

- try updating your project's maven configuration
- look at your workspace  ./metadata/.log to see if anything went wrong
- try reproducing the problem with a simpler project
- post your poms content if you can.

regards,

Fred Bricon


On Tue, Feb 2, 2010 at 12:30 PM, Eduardo M KALINOWSKI <[hidden email]> wrote:
On Seg, 01 Fev 2010, Fred Bricon wrote:
What versions of eclipse / m2eclipse are you using?

It's Eclipse 3.5 and m2eclipse 0.9.8.


Have you added the Maven Integration for WTP module?

I had not, stupid me. Just adding it did not change much, though.


EAR support starts to be very usable with m2e 0.9.9 dev, IMHO.

Thanks for the tip, I've upgraded my version and now the ear is created
correctly.

However, the war included inside the ear is still missing some required
external libraries (the other modules of the project are included, but
things such as struts are not in the WEB-INF/lib dir). Any further tips
regarding that?


--
 I can resist everything except temptation. -Oscar Wilde


Eduardo M KALINOWSKI
[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Including maven dependencies in war and ear generated by eclipse

Eduardo M KALINOWSKI-4
On Ter, 02 Fev 2010, Fred Bricon wrote:
> Eduardo,
>
> - try updating your project's maven configuration
> - look at your workspace  ./metadata/.log to see if anything went wrong
> - try reproducing the problem with a simpler project
> - post your poms content if you can.

I may have forgotten to update the project configuration (or clean it,  
or refresh, or something like that). Once I redid everything, things  
started working.

Things are working now, at least with regard to this problem. Thanks  
for the help.


--
Afternoon, n.:
        That part of the day we spend worrying about how we wasted the morning.

Eduardo M KALINOWSKI
[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email