Maven原型插件中的ClassNotFoundException

时间:2019-06-04 19:39:01

标签: maven maven-archetype

我正在使用Apache Maven 3.6.1从原型生成项目。

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate命令成功完成并生成预期结果时,mvn org.apache.maven.plugins:maven-archetype-plugin:generate生成此错误:

[WARNING] Error initializing: org.codehaus.plexus.velocity.DefaultVelocityComponent@4fbb001b
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
...
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize (ResourceManagerImpl.java:161)
...

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate failed: A required class was missing while executing org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate: org/apache/commons/lang/StringUtils

这是新版本的maven-archetype-plugin中的错误,还是可能是由于我这一边缺少一些配置?

0 个答案:

没有答案