0

我正在尝试使用 wagon-maven-plugin 将我的 p2 eclipse 存储库上传到 http 服务器。我配置了我的 settings.xml,如下所示。

 <server>
        <id>p2Repo</id>
        <username>xxx</username>
        <password>xxx</password>
        <configuration>
            <wagonProvider>httpclient</wagonProvider>
        </configuration>
    </server>

而eclipse-repository项目pom.xml如下:

  <distributionManagement>
    <repository>
        <id>p2Repo</id>
        <url>http://192.168.15.20:9001</url>
    </repository>
</distributionManagement>

 <properties>

    <!-- Relative path to the repo being uploaded -->
    <repo.path>${basedir}/target/repository/</repo.path>
</properties>


<extensions>
        <!-- Enabling the use of HTTP -->
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-http</artifactId>
            <version>1.0-beta-7</version>
        </extension>

    </extensions>

<build>
      <plugins>


        <!--  Upload the repo to the server -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>1.0</version>
            <executions>
                <execution>
                    <id>upload-repo</id>
                    <phase>install</phase>
                    <goals>
                        <goal>upload</goal>
                    </goals>
                    <configuration>
                        <fromDir>${repo.path}</fromDir>
                        <includes>*/**</includes>
                        <toDir>dependency</toDir>
                        <url>http://192.168.15.20:9001</url>
                        <serverId>p2Repo</serverId>
                    </configuration>
                </execution>
            </executions>
    </plugin>
   </plugins>
  </build>

在 Maven 构建期间,我收到如下错误

   [INFO] Uploading C:\Users\obulis\git\dependency-   bundles\target\repository\artifacts.jar to     http://192.168.15.20:9001/dependency/artifacts.jar ...
     Uploading: dependency/artifacts.jar to http://192.168.15.20:9001
    #http://192.168.15.20:9001/dependency/artifacts.jar - Status code: 405
  Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to      transfer file: http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405
  http://192.168.15.20:9001 - Session: Disconnecting  
  http://192.168.15.20:9001 - Session: Disconnected
  [INFO] -------------------------------------------------------------------    -----
  [INFO] BUILD FAILURE
   [INFO] -----------------------------------------------------------------  -------
    [INFO] Total time: 1:07.706s
    [INFO] Finished at: Sun Jul 19 19:36:49 IST 2015
    [INFO] Final Memory: 11M/27M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-   plugin:1.0:upload (upload-repo) on project dependency-bundles: Error handling   resource: Failed to transfer file:   http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405 -> [Help   1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to   execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload (upload-repo) on   project aqua-dependency-bundles: Error handling resource
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at     org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Error handling resource
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:68)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
    Caused by: org.apache.maven.wagon.TransferFailedException: Failed to   transfer file: http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:368)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:280)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:79)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:89)
at org.codehaus.mojo.wagon.UploadMojo.execute(UploadMojo.java:120)
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:64)
... 21 more
    [ERROR] 
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions,    please read the following articles:
    [ERROR] [Help 1]    http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

有什么建议吗?

提前致谢。

4

0 回答 0