【问题标题】:Grails Release plugin is not deploying plugin on a remote maven repositoryGrails Release 插件未在远程 Maven 存储库上部署插件
【发布时间】:2012-06-10 04:23:20
【问题描述】:

我在远程仓库上使用命令maven-deploy 部署插件时遇到问题。 我安装了最新版本的 Release 插件(2.0.2)。

我收到此错误:

| Loading Grails 2.0.4
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Compiling 33 GSP files for package [myPackage].....
| Plugin packaged grails-plugin-myPlugin.jar
| Skipping POM generation because 'pom.xml' exists in the root of the project..
| Error Error executing script MavenDeploy: : Error downloading wagon provider from the remote repository: Missing:
----------
1) org.apache.maven.wagon:wagon-http:jar:1.0-beta-2
Try downloading the file manually from the project website.
Then, install it using the command: 
  mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there: 
  mvn deploy:deploy-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency: 
1) unspecified:unspecified:jar:0.0
2) org.apache.maven.wagon:wagon-http:jar:1.0-beta-2
----------
1 required artifact is missing.

for artifact: 
 unspecified:unspecified:jar:0.0
from the specified remote repositories:
 central (http://repo1.maven.org/maven2)
(Use --stacktrace to see the full trace)

感谢您的帮助

【问题讨论】:

  • 你试过添加 wagon 作为插件的依赖项吗?

标签: grails maven repository grails-plugin


【解决方案1】:

这看起来像是一个 Maven 问题:

Maven 未能下载所需的依赖项 org.apache.maven.wagon:wagon-http:jar:1.0-beta-2 来自 http://repo1.maven.org/maven2

由于可以在 Maven central 中找到所需的工件,这可能是网络问题的结果

【讨论】:

  • 不要认为这是网络问题。我在代理后面并在 maven settings.xml 中对其进行了配置。我从 Maven 中心下载了 wagon-http-1.0-beta-2-sources.jar。但是当我运行 mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-http -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=/path/to/file i还会收到一个错误,表明禁止访问 repo...
  • 如果您在代理后面,它可能会阻止 jar 下载请求。您可以使用 -X -e 开关运行 maven 以获取有助于解决问题的其他信息。
  • 当您使用 install:install-file 时,它​​应该只使用您的本地存储库而无需任何外部连接...可能是文件系统中的权限问题?
【解决方案2】:

我有同样的问题,可以这样处理:

  • 安装 Maven2
  • here 所述配置代理

这足以解决您的问题。

如果您的 maven 服务器需要身份验证,您可以按照 herehere 的说明进行操作

~/.m2/settings.xml:

<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxyserver.mydomain.com</host>
      <port>8080</port>
      <username>user</username>
      <password>pass</password>
      <nonProxyHosts>*.bla.com.br|*.blabla.biz</nonProxyHosts>
    </proxy>
  </proxies>
  <servers>
    <server>
      <id>myrepo</id>
      <username>user</username>
      <password>pass</password>
    </server>
  </servers>
</settings>

【讨论】:

    【解决方案3】:

    我找到了解决此问题的方法。由于某些东西试图使用 deprecated http maven 存储库 url 检索 wagon-http 依赖项,因此我们可以在本地存储库中手动预安装此依赖项:

    mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -Dartifact=org.apache.maven.wagon:wagon-http:1.0-beta-2 -Dpackaging=jar -DrepoUrl=https://repo1.maven.org/maven2
    

    之后publish-plugin 命令应该可以工作了。

    解决该问题的可能方法是将grails-release 插件升级到v3.1.3(对我不起作用):link

    【讨论】:

      猜你喜欢
      • 2013-02-25
      • 1970-01-01
      • 1970-01-01
      • 2014-08-03
      • 1970-01-01
      • 1970-01-01
      • 2014-02-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多