Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Maven : How can i add folders and jars files in generated war ?

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I did have a GWT RequestFactory project ( hibernate, spring).
Eclipse Kepler Release is used.

It was time for me to push the work onto a Tomcat Server 6 but i had a couple of problems as follows.


1) mapping files ( folder and (**not added in the war**)

2) I understood that some jars cannot be found on maven repository, marked as provided. Thus, i did the necessary to add them to the local repository manually. (**Not added in the war**)

3) A (locate on file was present in the right directory but was missing after deploying the war. (**not added in the war**)

4) Last goal : when deploying the project (previous cases being fixed), it says 404 error.
In fact, it should open app.html file but seems to be impossible even if the following is added to configuration maven file. (`<runTarget>app.html</runTarget>`)


I did add those to my project and everything is working fine.
I must confess i'm problably using maven the worst way but it is convenient to me because i can clean/install my project without opening Eclipse to generate a war that i can upload directly through Tomcat Manager and everybody can get the project and run it afterwards without getting stucked at every corner.

I do apologize if those are dumb questions but even if i read other threads, i wasn't able to understand what to do.
May someone guide on how to add those files on the war ? (a light version of my pom.xml is added)

Kind regards,


pierre laurent
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last point resolved. Following was missing in web.xml.
Stupid mistake.


Still looking for the rest.
Posts: 5856
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Not sure exactly what you mean by mapping files, but non-java files (config files, etc.) that you expect to be packaged in your artifact should be placed in src/main/resource using the exact directory structure you want (e.g. src/main/resources/com/xxx/persistence/mapping). Note that only *.java files should appear in src/main/java!

2) Placing JARs not available in Maven Central into your local repository is an acceptable solution (another is to locate the repository those JARS are available in an configure that repository, an another is to use a repository manager such as Nexus and place such JARs in there). You also need to reference those JARs in the dependencies in your POM, then they should end up in the WEB-INF/lib directory in your WAR.

3) See point #1 (by the way saying things like "was present in the right directory" are meaningless - if it would have been in the right directory it would have appeared in the WAR file. It would be better if you would have provided the exact location of the file relative to you project's base directory; then we could have told you where the file should have been located)

4) I see you fixed this already, thank you for posting the solution.
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic