The StringUtils class was not found at Maven compile time

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.