Maven release plugin - release: execute - wrong SVN structure is generated
I have a maven project + 2 and I am using the maven release plugin to release a new version.
Unfortunately the goal
release: execute
doesn't work though
release: clean release: prepare
works great.
I already found the problem, but I have no idea how to fix it. This is my maven-release-plugin config:
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<tagBase>https://path_to_svn_server/ApplicationServer/tags/</tagBase>
<workingDirectory>${project.build.directory}/checkout/</workingDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
<scm>
<url>http://path_to_svn_server/ApplicationServer/trunk/</url>
<developerConnection>scm:svn:https://path_to_svn_server/ApplicationServer/trunk/</developerConnection>
</scm>
...
Problem:
release: prepare creates the following structure in my SVN repository:
+Branches
-Tags
-commons-0.0.1
+branches
+tags
-trunk
commons
commons.bom
commons.service
release: Try to download from the wrong unload directory, as you can see in the Maven log output:
--- maven-release-plugin:2.5.2:perform (default-cli) @ commons ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout
https://path_to_svn_server/ApplicationServer/tags/commons-0.0.8
path_to_workspace\ApplicationServer\trunk\commons\target\checkout"
[INFO] Working directory:
path_to_workspace\ApplicationServer\trunk\commons\target
[INFO] Executing goals 'deploy'...
[WARNING] Base directory is a file. Using base directory as POM location.
In fact, the "correct" path on my disk looks like this:
path_to_workspace\ApplicationServer\trunk\commons\target\checkout\trunk\commons
for testing purposes, I moved the community project (including modules) up one level, and then the new svn structure looks like this:
+Branches
-Tags
-commons-0.0.1
commons
commons.bom
commons.service
This workaround works great !! The version has been successfully deployed in my Archiva Repo. (But this is just a workaround ...)
I already tried to change the tagBase path and the workDirectory path, but unfortunately it still doesn't work.
one of my attempts:
<workingDirectory>${project.build.directory}/checkout/trunk
The result was:
path_to_workspace\ApplicationServer\trunk\commons\target\checkout\trunk\trunk\commons
Please help me to solve the problem? I'm guessing I need to fix the workDirectory path? But what's the right way to fix it? Thank you so much in advance!
EDIT:
If I am not mistaken, the SVN structure generated by the release: prepare, not quite ok ... Usually the TAG folder no longer contains "branches", "tags", "trunks".
Perhaps I need to fix tagbase instead of workDirectory ?? But how can I fix the SVN structure? Are there any additional settings that might help me?
source to share
I fixed the "problem".
You need to add the project name to the connectionConnection, after which the following SVN structure will be created:
+Branches
-Tags
-commons-0.0.1
commons
commons.bom
commons.service
instead
+Branches
-Tags
-commons-0.0.1
+branches
+tags
-trunk
commons
commons.bom
commons.service
In my case (multi-module build) I had to add the parent project to the DeveloperConnection.
Here is my config:
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<tagBase>https://path_to_svn_server/ApplicationServer/tags/</tagBase>
<workingDirectory>${project.build.directory}/checkout/</workingDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
<scm>
<url>http://path_to_svn_server/ApplicationServer/trunk/</url>
<developerConnection>scm:svn:https://path_to_svn_server/ApplicationServer/trunk/commons</developerConnection>
</scm>
...
<distributionManagement>
<repository>
<id>archiva.internal</id>
<name>Internal Release Repository</name>
<url>http://path_to_archiva_server/repository/internal</url>
</repository>
</distributionManagement>
mvn to start the whole process:
mvn release: clean release: prepare release: execute
Maybe I can help someone with my post :)
source to share