File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ear Building in Maven

 
Kris Massey
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys...Ive been trying to figure this out for a couple of hours now and just cant see the issue...

Below Ive added 5 pom.xml files that Ive fog...one Java Module, one EJB module, one Web module, One Enterprise Module and the master pom

Java Module



EJB Module


Web Module


Enterprise module


Master Pom



When I try and package everything the Java, EJB and Web modules work fine...however the Enterprise module fails with the error below



My file structure is
myMultiProjectArtifactId
--myJavaModule1
--myEJBModule1
--myWebApplicationModule1
--myEnterpriseApplicationModule


Im sure the problem is fairly simple but this is the first time Ive tried using maven this way and really am stumped..any help would be great!

Cheers
Kris
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very quick response here (I'm running out the door), I think it's because you haven't declared the dependencies in the POM for your EAR.
 
Kris Massey
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and thats where you lose me! do you mean like this?



Im sure you know what if I add it throws an error about a missing artifact...
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, Looking at it a little more in detail this morning (warning no coffee yet!), I see that you have in your EAR pom items like:

# <!-- 4.5.1. Include Java Module. -->
# <javaModule>
# <groupId>myMultiProjectGroupId.myMultiProjectArtifactId</groupId>
# <artifactId>module1</artifactId>
# <artifactId>1.0</artifactId>
#
# <!-- 4.5.1.1. Only if you want different file name inside "ear" file. -->
# <bundleFileName>myBundleJavaModule1FileName</bundleFileName>
# </javaModule>

I assume you're using Maven 2.0.10 or 2.1.0?

* Having <artifactId> twice seems wrong to me, but I wouldn't use javaModule in the first place (see next point)
* Using javaModule is deprecated, use jarModule instead, e.g.:



The dependency is then listed as:


 
Kris Massey
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help...

I managed to get it all working this morning after tinkering with a few things, all the changes were in the ejbModule pom file which Ive added incase anyone gets the same problem and comes across this.



One quick question is about the dependecy below Ive had to add



Could you give me a brief guide as to why this is needed?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure why you need that dependency, what complains when you don't have it?
 
Kris Massey
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


is the error I get, I googled it an everyone says just add it as provded inthe scope and everything works...seems a but of a bodge to me and I would like to know why its needed
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, I'm afraid I can't easily tell you why, I certainly don't include it for my Maven EAR builds!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic