How can I commit a single artifact like a file or a directory to an arbitrary location in a svn repository in the deploy lifecycle phase? With repository I mean a plain Subversion repository here, not a Maven repository held in a Subversion repository!
I have already evaluated the wagon-svn but it seems it can just be used to commit a whole module build to a Maven repository held in a Subversion repository.
This is my use case: I generate a JAR-file including all dependencies during build. This is to be used in Python scripts, so outside the Maven world. And I want to provide the current release JAR always at the same location in the repository holding the Python framework.
Before you do this I would carefully consider your reasons for doing so. Derived artifacts shouldn't be put into SCM as they can easily be rebuilt, instead you could consider attaching the artifact to your build so it is deployed alongside it.
This can be done with the build-helper-maven-plugin. The example config below will attach src/assembly/archive.xml as an additional artifact with the classifier "archive".
This artifact can be referenced directly by specifying the classifier and type in your dependency declaration. For example:
If you are set on doing it this way, the Maven SCM API provides an abstraction layer for common SCM providers and operations. The code below can be added to a mojo. It expects to be provided two parameters, the file to be committed to Subversion and the scm url. When bound to your project, it will commit the file to the Subversion repository.
Here's an example pom for the plugin, note the maven-plugin packaging:
Here's an example configuration that will check the file in during the package phase.
Or at a pinch you could use the antrun plugin to invoke the ant subversion library