Unable to run mvn install

时间:2015-06-26 10:23:15

标签: maven-3

I am getting the below error while trying to execute the mvn install command.

    [WARNING] Error injecting: org.sonatype.plexus.build.incremental.DefaultBuildContext
java.lang.NoClassDefFoundError: org/codehaus/plexus/util/Scanner
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
        at java.lang.Class.getDeclaredConstructors(Class.java:1901)
        at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
        at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
        at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:653)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:863)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210)
        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
        at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
        at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:116)
....
....
....
[ERROR] Failed to execute goal org.jasig.mojo.jspc:jspc-maven-plugin:2.0.0:compile (default) on project framework: Execution default of goal org.jasig.mojo.jspc:jspc-maven-plugin:2.0.0:compile failed: A required class was missing while executing org.jasig.mojo.jspc:jspc-maven-plugin:2.0.0:compile: org/codehaus/plexus/util/Scanner    
[ERROR] -----------------------------------------------------    
[ERROR] realm =    plugin>org.jasig.mojo.jspc:jspc-maven-plugin:2.0.0   
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy    
[ERROR] urls[0] = file:/C:/Users/xbblshs/.m2/repository/org/jasig/mojo/jspc/jspc-maven-plugin/2.0.0/jspc-maven-plugin-2.0.0.jar    
[ERROR] urls[1] = file:/C:/Users/xbblshs/.m2/repository/org/jasig/mojo/jspc/jspc-compiler-tomcat7/2.0.0/jspc-compiler-tomcat7-2.0.0.jar
[ERROR] urls[2] = file:/C:/Users/xbblshs/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[3] = file:/C:/Users/xbblshs/.m2/repository/org/apache/ant/ant/1.9.0/ant-1.9.0.jar
[ERROR] urls[4] = file:/C:/Users/xbblshs/.m2/repository/org/apache/ant/ant-launcher/1.9.0/ant-launcher-1.9.0.jar
[ERROR] urls[5] = file:/C:/Users/xbblshs/.m2/repository/org/apache/tomcat/tomcat-jasper/7.0.39/tomcat-jasper-7.0.39.jar
[ERROR] urls[6] = file:/C:/Users/xbblshs/.m2/repository/org/apache/tomcat/tomcat-servlet-api/7.0.39/tomcat-servlet-api-7.0.39.jar
[ERROR] urls[7] = file:/C:/Users/xbblshs/.m2/repository/org/apache/tomcat/tomcat-juli/7.0.39/tomcat-juli-7.0.39.jar    
[ERROR] urls[8] = file:/C:/Users/xbblshs/.m2/repository/org/apache/tomcat/tomcat-jsp-api/7.0.39/tomcat-jsp-api-7.0.39.jar
[ERROR] urls[9] = file:/C:/Users/xbblshs/.m2/repository/org/apache/tomcat/tomcat-el-api/7.0.39/tomcat-el-api-7.0.39.jar

I am a newbie to maven. I am not sure what I am missing. Please advise me on how to resolve this and run mvn install.

2 个答案:

答案 0 :(得分:2)

所以,这是您需要添加到pom.xml文件的依赖项

<dependency>
    <groupId>org.jasig.mojo.jspc</groupId>
    <artifactId>jspc-maven-plugin</artifactId>
    <version>2.0.0</version>
</dependency>

然后再次尝试mvn install

答案 1 :(得分:1)

首先,您可以创建一个简单的maven项目进行安装,以检查您的环境是否正常。 其次,它说noClassDefFoundError,我想你可能忘记在其中添加一些依赖。作为一些罐子或资源,它依赖于其他人。