Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven War

 
Phani.Kiran Gutha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every one,
I have a war file build already using ant. which is super project.

I have child project where i want to add some more files to the existing war file and deploy the war file. in maven pom.

I have added the super war as dependency in the pom but the resultant war file doesnt contain any thing

<dependency>
<groupId>eagle</groupId>
<artifactId>webui</artifactId>
<version>1.23</version>
<type>war</type>
<scope>runtime</scope>
</dependency>

Can any one suggest me!

Thanks
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you built the WAR using Ant, you'll have to manually install it into your Maven repository. Maven pulls all its dependencies from repositories. When you build a war with Maven, the "install" goal will install the product into the repository, but Ant doesn't do that without being helped.
 
Phani.Kiran Gutha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"If you built the WAR using Ant, you'll have to manually install it into your Maven repository. Maven pulls all its dependencies from repositories. When you build a war with Maven, the "install" goal will install the product into the repository, but Ant doesn't do that without being helped."


Hi Tim,
I have installed the ant build war file into the repository.
my project strucuture is like this.





pom of webui is building a war file using the dependecy of the war file build by ant. and installing into the local repository.

But when i run maven build on parent/pom.xml a war file parent-1.0.war is build which contains nothings.

am facing problem when deploying parent project to jboss in eclipse the war file deployed into jboss deploy folder contains nothing?

Can you help me!!!

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not a valid Maven directory layout. You should have something like this:



This layout will compile the classes in src/main/java, and combine them will the JSP, HTML and other files in src/main/webapp and build the WAR.

You mentioned Eclipse. Are you using the m2eclipse plugin? And are you using m2eclipse to create a Maven project?

P.S. I edited your last post. Please don't use the code tag when quoting others (really screws up the page formatting), use the quote tag instead. Also, do use the code tag when posting file structures and directory hierarchies, otherwise they are incomprehensible.
 
Phani.Kiran Gutha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Johnson,

Thanks for your valuable suggestions about using the forum....................


And
am using M2 eclipse plugin , project and its modules were created using maven project........

comming to directory structure

directory structure mentioned by you is correct but. my project needs to be in structure i have mentioned ....
cant we change the directory structure and make it work!

Please help me!

Thanks once again!
 
Phani.Kiran Gutha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phani.Kiran Gutha]"If you built the WAR using Ant, you'll have to manually install it into your Maven repository. Maven pulls all its dependencies from repositories. When you build a war with Maven, the "install" goal will install the product into the repository, but Ant doesn't do that without being helped.

Hi Tim,
I have installed the ant build war file into the repository.
my project strucuture is like this.





pom of webui is building a war file using the dependecy of the war file build by ant. and installing into the local repository.

But when i run maven build on parent/pom.xml a war file parent-1.0.war is build which contains nothings.

am facing problem when deploying parent project to jboss in eclipse the war file deployed into jboss deploy folder contains nothing?

Can you help me!!!

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
directory structure mentioned by you is correct but. my project needs to be in structure i have mentioned ....
cant we change the directory structure and make it work!

Yes you usually can, if you like fighting with Maven. And if you don't mind that some Maven plugins will not work if you don't follow the standard layout. My suggestion is to abandon your layout and stick with the standard Maven layout.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic