donderdag 27 september 2007

mvn site:deploy on windows

I had to find a way to deploy javadoc towards a server. So I found out that the maven site has a reporting plugin for javadocs. To get all this working on windows follow these steps:

We need SSH so I installed cygwin with the following modules:

openssh
tcp_wrappers
zlip
unzip

After installation of cygwin run it and on the console execute the following command to import your windows system users into cygwin:
mkpasswd   -cl   >   /etc/passwd
mkgroup --local > /etc/group


If you are logging on to a domain you'll probably need to modify the /etc/group file to match the group ids with /etc/passwd.

The error I got because of this problem was something with setgid


Could be due to myself but I thought this referenced explanation was confusing. What you should do is open the /etc/passwd file. See for the line with as first element (separated by :) your username. Then see if the 4th element (counting from 1, so the GID in name:password:uid:GID:gecos:home:shell) matches the third field on the line with name Users in /etc/group. When these do not match edit the /etc/group file to fix this problem.


Now you can start the SSH server with the following command from within cygwin (don't know if altering users config requires restart of cygwin?):
net start sshd


And now you can go back to maven to deploy your site. Maven needs the following configuration. Edit POM to contain:
<distributionManagement>
<site>
<id>website</id>
<url>scp://localhost/cygdrive/c/PATH_TO_TOMCAT/webapps/mvnsites/${project.version}</url>
</site>
</distributionManagement>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</reporting>


Replace the PATH_TO_TOMCAT or any other server.


Then execute the following goals:
mvn javadoc:javadoc
mvn site:site
mvn site:deploy


resources:
http://pigtail.net/LRP/printsrv/cygwin-sshd.html
http://maven.apache.org/plugins/maven-javadoc-plugin/
http://maven.apache.org/plugins/maven-site-plugin/
http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-maven.html

Geen opmerkingen:

Een reactie plaatsen