• 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

Maven War

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic