...
Code Block |
---|
$ mvn archetype:generate -B \ -DgroupId=tutorial \ -DartifactId=tutorial \ -DarchetypeGroupId=org.apache.struts \ -DarchetypeArtifactId=struts2-archetype-blank \ -DarchetypeVersion=2.1.6<version> $ ls tutorial/ $ cd tutorial $ ls pom.xml src/ |
Depending on the state of your local system you may see Maven downloading various libraries (known as "downloading the internet", which is what it seems Maven does sometimes). Be patient--Maven is basically setting up your required libraries automatically.
<version> - is the version of Struts 2 you want to use and archetype was released for, eg. 2.1.8.1 .
Staging repository
If the above command will fail because of missing archetypes in central repository, you can try to use staging repository like below
Code Block |
---|
mvn archetype:generate -B \
-DgroupId=tutorial \
-DartifactId=tutorial \
-DarchetypeGroupId=org.apache.struts \
-DarchetypeArtifactId=struts2-archetype-blank \
-DarchetypeVersion=<version>
-DarchetypeCatalog=http://people.apache.org/builds/struts/<version>/m2-staging-repository/
|
Project Structure
The source code structure follows the normal Maven directory structure. The blank-archetype does not include all of the directories listed in the Maven structure reference page.
...
This mapping is the last mapping contained in example.xml
--anything not handled by mappings appearing before it in example.xml
will be caught by this mapping. This mapping will look for JSP files in src/main/webapp/example/*.jsp
. Since there's a Welcome.jsp
in that directory, we're all set. See the Wildcard MappingMappings page for more information on how Struts 2 can use wildcard mappings.
...