mavenmaven-wagon-pluginwagon

Maven Wagon plugin Post


I have some xml files and I want to upload them to my domain. Only way i can do it is through endpoint. I have configured maven wagon plugin like below

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0</version>
                <goals>
                    <goal>upload</goal>
                </goals>
                <configuration>
                    <fromDir>target</fromDir>
                    <includes>*jssp.xml</includes>
                    <url> http://mydomain/endpoint?__sessiontoken=admin/admin</url>
                </configuration>
            </plugin>

And i have this

Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload (default-cli) on project AdobeCampaignUploader: Error handling resource: Access denied to: http://mydomain/endpoint?__sessiontoken=admin/admin/file.xml

How to POST this file to remote location properly?


Solution

  • You are probably missing your authentication here. To ~/.m2/settings.xml, add your http credentials, then use these here in your pom.