Maven-archetype-webapp directory structure?

Is it possible or workaroud to use the maven-archetype-webapp archetype to generate maven webapp with a simple directory structure like

/src /main /java /resources /webapp /test /java /resources 
+4
source share
2 answers

I assume that your problem is with the missing java and test folders in the new project when using maven-archetype-webapp. There is no alternative to add this archetype. Of course, you could add them manually after creating the project.

You can find another archetype in one of these lists:

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

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

+7
source

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

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

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

2) If you use the eclipse IDE, you can issue the command below to convert your maven project to an Eclipse web project.

  mvn eclipse:eclipse -Dwtpversion=2.0 

This step 2 is optional if you do not plan to associate it with eclipse

thanks

+2
source

Source: https://habr.com/ru/post/1494449/


All Articles