Can anybody tell me how to make checkout and further updates from SVN with Maven? I read the documentation on maven.apache.org but it seems that i'm too dumb for this because i can't understand how to use scm:checkout and scm:update without passing them parameters in command line. I mean when i run just:
mvn scm:checkout (or scm:update) clean install
maven checks out sources to /target/checkout, then it deletes it and of course it has nothing to compile so it makes empty jar. So i have to write something like this:
mvn scm:checkout -DconnectionUrl=scm:svn:http://svn.my.dev/scm/repo/trunk/myProject -DcheckoutDirectory=src clean install
But i don't want to! How can i set these parameters inside pom.xml? And how can i set current directory as checkoutDirectory? (probably it should not be a problem if set it in pom.xml because i can set it as ${project.basedir}, but who knows) My pom.xml includes these lines:
...
<scm>
<connection>scm:svn:http://svn.my.dev/scm/repo/trunk/myProject</connection>
<developerConnection>scm:svn:http://svn.my.dev/scm/repo/trunk/myProject</developerConnection>
</scm>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.7</version>
<configuration>
<username>username</username>
<password>password</password>
</configuration>
</plugin>
...
Btw, what is the difference between connection and developerConnection. Maven documentation says only that developerConnection is... "The SCM connection URL for developers". Which is very surprising for me 'cause i thought that this is some connection for squirrels or may be bunnies.
You can add the checkoutDirectory
option directly to the configuration of the maven-scm-plugin. Once the files are checked out, you can use scm:update
with the workingDirectory
option (can be configured in the plugin configuration as well)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.7</version>
<configuration>
<username>username</username>
<password>password</password>
<checkoutDirectory>${project.basedir}/src</checkoutDirectory>
<workingDirectory>${project.basedir}/src</workingDirectory>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With