This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Ear Plugin

 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am struggling with learning how to use the maven ear plugin for a project that I am building. I have almost zero experience with plugins in maven. I tried looking at the documentation but in my opinion its definitely not the best....Does anyone have some good resources as I couldn't really find any that went in depth or could explain it here?
 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what about Gradle, would you recommend Gradle over Maven?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charles,
There's lots of examples on the Maven ear plugin page. You'll need to post your pom.xml and the error you are encountering though.
 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so after a fews of playing and trying to put the pieces together from the maven ear plugin docs.....I get a jar file after mvn package.....mvn package -X produces 0 errors.....

how do I get the ear file? Do I need to specify the jar and war module? Do I need to create an war and jar file dependency for the project using the artifact and groupd id?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something obvious I see missing in your pom.xml is
 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You, that fixed my problem but now introduced a new problem with the two servlets I have.....I will try to figure it out and if not ask another question.....
 
Charles Sexton
Ranch Hand
Posts: 272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I was still struggling to get the ear file created after learning a little bit about Maven ear plugin. I got definitely a little closer on the weekend but hit a stump where the ear file wasn't even being created with the above pom.xml file. So i did more research and learned that a dynamic web project will only generate a war file in eclipse. I did more research started an enterprise application project in eclipse and saw that it literally created two modules and one project. I was confused as to how the pieces were put together. I played around with it for awhile but could never get the ear file generated. I came across this resource and wonder what you guys think about it. Is this a pretty optimal solution for creating an enterprise application in JEE? What if I wanted to add JMS, would that go in the war module for the servlet container?

resource for creating an ear project in eclipse with maven
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic