~/work/archetypes$
mvn archetype:generate -Dfilter=org.apache.cxf.archetype:
[INFO] Scanning
for
projects...
[INFO]
......
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:
1.0
)
Choose archetype:
1
: remote -> org.apache.cxf.archetype:cxf-jaxrs-service (Simple CXF JAX-RS webapp service using Spring configuration)
2
: remote -> org.apache.cxf.archetype:cxf-jaxws-javafirst (Creates a project
for
developing a Web service starting from Java code)
Choose a number or apply filter (format: [groupId:]artifactId,
case
sensitive contains): :
1
Choose version:
1
:
2.5
.
1
2
:
2.5
.
2
-SNAPSHOT
Choose a number:
2
:
1
Downloading: http:
Downloaded: http:
......
Define value
for
property
'groupId'
: : org.examples.rest
Define value
for
property
'artifactId'
: : simple
Define value
for
property
'version'
:
1.0
-SNAPSHOT: :
Define value
for
property
'package'
: org.examples.rest: :
Confirm properties configuration:
groupId: org.examples.rest
artifactId: simple
version:
1.0
-SNAPSHOT
package
: org.examples.rest
Y: : Y
[INFO] project created from Archetype in dir: ~/work/archetypes/simple
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
~/work/archetypes$ tree simple
simple
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── org
│ │ └── examples
│ │ └── rest
│ │ ├── HelloWorld.java
│ │ └── JsonBean.java
│ └── webapp
│ └── WEB-INF
│ ├── beans.xml
│ └── web.xml
└── test
└── java
└── org
└── examples
└── rest
└── HelloWorldIT.java
~/work/archetypes$ cd simple
~/work/archetypes/simple$ mvn install
[INFO] Scanning
for
projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple CXF JAX-RS webapp service using spring configuration
1.0
-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http:
......
[INFO] --- maven-compiler-plugin:
2.3
.
2
:compile (
default
-compile) @ simple ---
[INFO] Compiling
2
source files to ~/work/archetypes/simple/target/classes
[INFO]
......
[INFO] --- maven-war-plugin:
2.1
.
1
:war (
default
-war) @ simple ---
......
[INFO] Building war: ~/work/archetypes/simple/target/simple-
1.0
-SNAPSHOT.war
[INFO]
[INFO] <<< tomcat-maven-plugin:
1.1
:run-war (start-tomcat) @ simple <<<
[INFO]
[INFO] --- tomcat-maven-plugin:
1.1
:run-war (start-tomcat) @ simple ---
[INFO] Running war on http:
......
INFO: Starting tomcat server
06
-Jan-
2012
12
:
47
:
53
org.apache.catalina.core.StandardEngine start
......
INFO: Starting Coyote HTTP/
1.1
on http-
47586
[INFO]
......
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.examples.rest.HelloWorldIT
Tests run:
2
, Failures:
0
, Errors:
0
, Skipped:
0
, Time elapsed:
0.823
sec
Results :
Tests run:
2
, Failures:
0
, Errors:
0
, Skipped:
0
......
[INFO]
[INFO] --- maven-install-plugin:
2.3
.
1
:install (
default
-install) @ simple ---
[INFO] Installing ~/work/archetypes/simple/target/simple-
1.0
-SNAPSHOT.war to ~/.m2/repository/org/examples/rest/simple/
1.0
-SNAPSHOT/simple-
1.0
-SNAPSHOT.war
[INFO] Installing ~/work/archetypes/simple/pom.xml to ~/.m2/repository/org/examples/rest/simple/
1.0
-SNAPSHOT/simple-
1.0
-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
~/work/archetypes/simple$