Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven-archetype-webapp Directory Structure?

Is there a possibility or a workaroud to use maven-archetype-webapp archetype to generate a maven webapp with plain directory structure like

 /src

    /main

        /java 
        /resources 
        /webapp 

    /test 
        /java 
        /resources 
like image 439
Festus Tamakloe Avatar asked Jan 13 '23 18:01

Festus Tamakloe


2 Answers

I assume that your issue is the missing java and test folders in a new project when using maven-archetype-webapp. There are no options to make that archetype to add those. Of course you could add them manually after the project was created.

You may find another archetypes in one of these lists:

  • http://myjeeva.com/exclusive-maven-archetype-list.html
  • http://docs.codehaus.org/display/MAVENUSER/Archetypes+List

If there is nothing that matches what you need I suggest creating an own archetype: http://maven.apache.org/guides/mini/guide-creating-archetypes.html

It is quite easy and if you plan to use one several times it's probably worth the effort.

like image 115
wemu Avatar answered Jan 21 '23 11:01

wemu


Actually I am not very sure of what you are asking, I mean are you looking for an alternative solution to maven-archetype-webapp ?

With maven archetype you can create the above mentioned directory structure without any hassle, of course java and test folders will be missing there.

mvn archetype:generate -DgroupId=com.techidiocy -DartifactId=FirstWeb
-DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false  

2) If you are using eclipse IDE , then you can issue the command mentioned below to convert your maven project into an Eclipse Web Project.

  mvn eclipse:eclipse -Dwtpversion=2.0

This Step 2 is optional , if you are not planning to bind it with eclipse

Thanks

like image 33
saurav Avatar answered Jan 21 '23 09:01

saurav