Maven deploy jar to svn with commit message

We are using maven repo managed in SVN. I have built a jar newUtil-1.0.jar

that I need to deploy to a remote repo. I am using the following command which causes the build to fail.

mvn deploy:deploy-file -Dfile=/tmp/newUtil-1.0.jar -DgroupId=com.tareque.utils -DartifactId=newUtil -Dversion=1.0 -Dpackaging=jar -DrepositoryId=myrepo -Durl=https://<my-repo-url>

Checking server side logs for svn

showing this message

[Fri Jan 18 11:35:47 2013] [error] [client 169.124.140.200] Commit locked by pre-commit (exit code 1) with exit: \ nThis comment is not allowed.

by which it seems that a commit with empty posts / comments is locked.

So how do you pass a comment to report the above command maven deploy

?

+3


source to share


1 answer


Don't use deploy, use maven-release-plugin

. Setting up a commit message in this case is easy:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <configuration>
        <scmCommentPrefix>re #123:</scmCommentPrefix>
      </configuration>
    </plugin>  ......

      

You will need to search a little for whatever other parameters are required to use the release plugin (tags <scm>

and <distributionManagement>

to begin with), but after you work with mvn release:prepare release:perform

this additional configuration parameter will allow you to change the commit message.



Trust me, once you use the release plugin correctly, you won't want to go back to manual releases.

ETA: If you are actually trying to deploy snapshots in SVN (it sounds like nuts and I've never seen it, but it should be possible), you would like to investigate usingwagon-scm

your section to <distributionManagement>

use scm:svn:https://your-repo-url

. If you get it, let us know!

+2


source







All Articles