• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ear Building in Maven

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic