解决插件版本的错误':maven-assembly-plugin'

时间:2013-03-25 12:37:25

标签: maven plugins tomcat7 pom.xml cloudfoundry

我正在开发一个Spring应用程序,我在其中添加了EL2.2,这需要tomcat 7.该应用程序部署在Cloud Foundry上,它只提供tomcat 6.因此我必须遵循以下指令: https://github.com/ericbottard/cloudfoundry-tomcat-7/blob/master/README.md

一切正常但我现在在我的pom.xml中有一个错误说:

Error resolving version for plugin 'com.luke.timetable:maven-assembly-plugin' from the repositories [local (C:\Users\Luke.m2\repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository

我不确定在上面给出的指令的步骤4中需要执行哪些修改(如果有的话),任何想法?

感谢您的帮助。

修改 我改变了以下评论中的建议,但现在我的问题是该应用程序无法在Cloud Foundry上运行。它在pom.xml中存在错误时有效,但是一旦我删除它就会出现此错误

java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type avax/el/ExpressionFactory; used in the signature at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:694) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:244) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

我在本地tomcat 6和云代工厂都得到了上述异常,当pom.xml中存在错误时(下面给出修复的那个),该应用程序可以在本地tomcat 6和云代工厂上运行。 感谢。

1 个答案:

答案 0 :(得分:1)

maven-assembly-plugin的groupId是:

org.apache.maven.plugins

而不是

com.luke.timetable

这意味着给定的信息必须如下所示:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.4</version>
  ...
</plugin>