Today on Jersey's official website, execute the command as follows:
MVN archetype:generate-darchetypeartifactid=jersey-quickstart-grizzly2 \
-darchetypegroupid=org.glassfish.jersey.archetypes-dinteractivemode=false \
-dgroupid=com.example-dartifactid=simple-service-dpackage=com.example \
-darchetypeversion=2.21
The following error occurred while generating the jersey code:
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time:0.626 S
[INFO] Finished at:2015-09-21t20:33:50+08:00
[INFO] Final memory:10m/155m
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (DEFAULT-CLI) on project Standalone-pom:execution Default-cli of Goal Org.apache.maven.plugins:maven-archet
Ype-plugin:2.4:generate failed:a required class is missing while executing org.apache.maven.plugins: Maven-archetype-plugin:2.4:generate:org/apache/commons/lang/stringutils
...
Problem cause Analysis: You can see from the error message that the Commons-lang StringUtils class was not found when executing the Maven-archetype-plugin plugin. By viewing the MAVEN local repository Maven-archetype-plugin-2.4.pom file, you find that the dependencies for the Commons-lang package are not configured, so configure the following dependencies:
<dependency>
<groupId>commons-lang</groupId>
<artifactid>commons-lang</ artifactid>
<version>2.3</version>
</dependency>
Re-execute the above command, OK.