How can I tell wagon-maven-plugin to use a username and password from my settings.xml? -
i'm generating (non javadoc) documentation of rest api using plugin named maven-enunciate-plugin. want upload javadoc repository. i'm using wagon-maven-plugin this.
the problem is, can't figure out how tell wagon plugin use username/password in settings.xml site. if use maven-site-plugin, seems know how defining distributionmanagement
tag, i'm not using maven-site-plugin plugin because i'm generating documentation without it.
here's pom show i've tried:
<profile> <id>generate-rest-doc</id> <build> <plugins> <plugin> <groupid>org.codehaus.enunciate</groupid> <artifactid>maven-enunciate-plugin</artifactid> <version>1.27</version> <executions> <execution> <goals> <goal>docs</goal> </goals> <configuration> <docsdir>${project.build.directory}/docs</docsdir> </configuration> </execution> </executions> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>wagon-maven-plugin</artifactid> <version>1.0-beta-4</version> <executions> <execution> <id>upload-javadoc</id> <phase>package</phase> <goals> <goal>upload</goal> </goals> <configuration> <fromdir>${project.build.directory}/docs</fromdir> <includes>*</includes> <url>scp://my-repo/var/www/html/projects/rest-war</url> </configuration> </execution> </executions> </plugin> </plugins> </build> <distributionmanagement> <site> <id>javadoc</id> <url>scp://my-repo/var/www/html/projects/-rest-war</url> </site> </distributionmanagement> </profile> .... <extensions> <extension> <groupid>org.apache.maven.wagon</groupid> <artifactid>wagon-ssh</artifactid> <version>1.0-beta-6</version> </extension> </extensions> </build>
i figured out workaround. instead of using wagon-maven-plugin directly, use maven-site-plugin. explicitly use deploy goal point directory maven-enunciate-plugin generated.
so above commented out wagon plugin , added below enunciate plugin:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-site-plugin</artifactid> <version>3.3</version> <dependencies> <dependency> <groupid>org.apache.maven.wagon</groupid> <artifactid>wagon-ssh</artifactid> <version>2.4</version> </dependency> </dependencies> <executions> <execution> <id>upload-javadoc</id> <phase>package</phase> <goals> <goal>deploy</goal> </goals> <configuration> <inputdirectory>${project.build.directory}/docs</inputdirectory> </configuration> </execution> </executions> </plugin>
Comments
Post a Comment