由于缺少依赖性,Maven Build失败 - 初学者

时间:2011-09-07 16:35:43

标签: java spring maven google-code

[ERROR] Failed to execute goal on project CarProject: Could not resolve dependen
     cies for project CarProject:CarProject:war:1.0-SNAPSHOT: The following artifacts
    could not be resolved: com.googlecode.sslplugin:struts2-ssl-plugin:jar:1.2.1, o
     rg.springframework:org.springframework.web.servlet:jar:3.0.5.RELEASE, org.spring
    framework:org.springframework.context:jar:3.0.5.RELEASE, javax.transaction:com.s
     pringsource.javax.transaction:jar:1.1.0, com.sun:tools:jar:1.6.0: Failure to fin
       d com.googlecode.sslplugin:struts2-ssl-plugin:jar:1.2.1 in http://repo1.maven.or
      g/maven2 was cached in the local repository, resolution will not be reattempted
     until the update interval of central has elapsed or updates are forced -> [Help
      1]

似乎缺少多个依赖项,我应该如何添加它们?有没有可以获得依赖的地方,还是有一种特定的标准写作方式?

2 个答案:

答案 0 :(得分:1)

org.springframework.web.servlet = spring-web或spring-webmvc或两者,具体取决于您的需求

org.springframework.context = spring-context

com.springsource.javax.transaction来自SpringSource enterprise bundle repository

struts2-ssl-plugin不在中心位置。您必须在另一个存储库install it locally中找到它,将其安装在您自己的存储库中,例如Nexus,或将其设置为system-scoped dependency

工具是您的JRE。 Maven大多不应该尝试下载它。你可能在某处有一个糟糕的依赖。

答案 1 :(得分:0)

从以下位置下载最新的jar文件 http://code.google.com/p/struts2-ssl-plugin/downloads/list

运行以下命令 struts2-ssl-plugin-1.2.1.jar文件的示例

mvn install:install-file -Dfile = E:\ Java \ Meteors \ struts2-ssl-plugin-1.2.1.jar -DgroupId = com.googlecode.sslplugin -DartifactId = struts2-ssl-plugin -Dversion = 1.2 .1 -Dpackaging = jar