简体   繁体   中英

Grails Release plugin is not deploying plugin on a remote maven repository

I'm having problems to deploy a plugin with the command maven-deploy on a remote repo. I installed the latest version of the Release plugin (2.0.2).

I get this error:

| 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)

Thanks for your help

I had the same problem and could handle it this way:

  • Install Maven2
  • Configure proxy as described here

This is enough to solve your problem.

If your maven server requires authentication you can proceed as describedhere or here

~/.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>

This looks like a Maven issue:

Maven fails to download a required dependency org.apache.maven.wagon:wagon-http:jar:1.0-beta-2 from http://repo1.maven.org/maven2

Since the required artifact can be found in Maven central this may be a result of a networking issue

I found a workaround for this issue. Since something tries to retrieve wagon-http dependency using deprecated http maven repository url, we can manually preinstall this dependency in our local repository:

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

After that publish-plugin command should work.

Possible fix for that issue would be upgrade grails-release plugin to v3.1.3 (didn't work for me): link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM