Question

I would like to create a web project using Maven 2 + Struts 1. Would someone provide me some tutorial or a website outlining the steps? Thank you. ;)

Was it helpful?

Solution

There is a Struts 1 Blank Archetype for Maven 2:

$ mvn archetype:create                                \
      -DarchetypeGroupId=org.apache.struts            \
      -DarchetypeArtifactId=struts-archetype-blank    \
      -DarchetypeVersion=1.3.5                        \
      -DgroupId=com.example                           \
      -DpackageName=com.example.projectname           \
      -DartifactId=my-webapp

OTHER TIPS

In case you need additional information on obtaining the struts-archetype-blank archetype:

Step #1

The struts-archetype-blank archetype is no longer in the default Maven2 repository. Therefore you have to check it out manually from http://svn.apache.org/repos/asf/struts/maven/trunk/struts-archetype-blank.

Step #2

Build the struts-archetype-blank-1.3.5-SNAPSHOT.jar file: mvn install.

Step #3

Install the archetype:

mvn install:install-file
    -DgroupId=org.apache.struts
    -DartifactId=struts-archetype-blank
    -Dversion=1.3.5-SNAPSHOT
    -Dpackaging=jar
    -Dfile=struts-archetype-blank-1.3.5-SNAPSHOT.jar

Step #4

Create your Struts1 Maven2 project (as Pascal Thivent pointed):

mvn archetype:create
    -DarchetypeGroupId=org.apache.struts
    -DarchetypeArtifactId=struts-archetype-blank
    -DarchetypeVersion=1.3.5-SNAPSHOT
    -DgroupId=com.example
    -DpackageName=com.example.projectname
    -DartifactId=my-webapp

Good Luck!

Are you searching for a tutorial on Maven 2 or on Struts ? mvn archetype:generate should be your friend. Take a look into the docs about archetype.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top