Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Maven structure for both Javascript and Java Servlet

 
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • 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
  • 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: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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
  • 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

 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic