• 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 structure for both Javascript and Java Servlet

 
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear coderanch,

Thanks in advance for any help.

I have an application that has modules that handle launching of games.  This involves Javascprt, html and a few Servlets.

I've got to refactor this in to a single module.  This "launching" module will house all launching stuff (Javascript and Java web services for tomcat servlets).

The JS is compiled using Google closure, and the Servlet is javax.servlet and other core Java commons.

What should the top-level pom.xml packaging be?

Im not really sure how to structure this.  As it currently stands I have to deal with (refactor):

parent
module A
---> web services
module B
---> Javascript


But I've been asked to group this (currently split) functionality across A & B, in to a single new module (i.e a launching module).

Im stuck at the first hurdle - how should i structure my project?

Regards, Sam

 
sam wootton
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess my real decision is whether to have

project C
pom.xml
---> java module
--------> src, main test, target
---> javascript module
--------> src, main test, target

or

project C
pom.xml
---> src
--------> javascript
--------> java
---> main
---> target
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think to match Maven's default structure, you need to use src/main/java for Java source files and src/main/webapp for JavaScript files.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Knute Snortum wrote:I think to match Maven's default structure, you need to use src/main/java for Java source files and src/main/webapp for JavaScript files.


Yes.

Sam: You can see the standard directory layout here

You likely want the package type to be war since you have a servlet in there.
 
sam wootton
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both for your replies. I ended up following the Maven structure for the new project.

Thanks again.

Regards, Sam

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic