javamavenhttpmaven-wagon-plugin

Force Maven Wagon plugin to POST instead of PUT


We're trying to use the Nexus APT plugin, but sending artifacts to it requires them to be POSTed not PUTed. The default Wagon implementation wants to HTTP Put it seems, because we're getting a 405 error back.

Is there a way to tell wagon to POST instead of PUT? I can't find it in the docs.

Thanks!

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>wagon-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>upload-deb-to-nexus</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>upload-single</goal>
                            </goals>
                            <configuration>
                                <serverId>xxx-nexus-apt</serverId>
                                <fromFile>${project.build.directory}/${jdeb.name}</fromFile>
                                <url>https://xxx.xxx.com/repository/xxx-nexus-apt</url>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

Solution

  • Looked at the code for the Wagon http provider, PUT is hardcoded.