• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Build Script Problem

 
Deep Mukherjee
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem building my project with maven.I have to create a war file
containing a ejb jar and a war.
i have separate pom.xml for ejb project and a web project..
structure should be like this....

source project
.
.
......pom.xml
.
.
........ejb project
. .
. .
. .
. .......source code
. .
. .
. .......pom.xml
.
.
.
.
.........web project
.
.
.
.
.....source code
.
.
.
.....pom.xml


individually i am able to create ejb jar(ejb project) and war (web project).
but i want to do mvn install only on source project and it would bild the jar
(ejb project)and war(web project) and then(source project) create a ear in one
go.can any one suggest what modification i have to do on pom.xml of source project
for doing this and also web project has dependency on ejb project .Can any one please give me sample
example of source pom.how should it looks like
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what I do. I create a master Maven project with three subprojectsne to build the WAR, one to build the JAR and one to build the EAR. Directory layout is similar to:

masterproject
masterproject/warproject
masterproject/ejbproject
masterproject/earproject

The pom.xml in masterproject calls the three subprojects. The pom.xml in the subprojects all reference the mastterproject as the parent project. When I run the masterproject pom.xml, it builds everything.
 
Deep Mukherjee
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please give the sample pom of the parent project.....what are tags need tobe used....
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a copy of Better Builds with Maven, right? Look in chapter 4, Building J2EE Applications, specifically section 4.3, Organizing the DayTrader Directory Structure. Or if you have Maven - The Definitive Guide, see chapter 6, A Multimodule Project; it's parent pom.xml is more complete.
 
Deep Mukherjee
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another question,How can i inclue or exclude .java (source)file in the ejb jar or war file.I want to customize the source folder structure.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since that is a different question, you should start a new post.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic