I have the following (simplified) folder structure:
pom.xml (with correct scm)
src/folder1
src/folder2
folder1 and folder2 each conatain a test.txt file. folder1 is already committed, folder2 is not yet under version control.
What I try to do is to add the file src/folder2/test.txt to version control.
If I execute
mvn scm:add -Dbasedir=${project.basedir}/src -Dincludes=**/folder2/*
I get this message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: 'src/folder2' is not a working copy
Because the pattern **/folder2/* does not include folders I tried to add the folder first:
mvn scm:add -Dbasedir=${project.basedir}/src -Dincludes=**/folder2/
Same error message. With
mvn scm:add -Dbasedir=${project.basedir}/src -Dincludes=**/folder2
(i.e. without trailing slash) I got the message
"Exception while executing SCM command. You must provide at least one file/directory to add"
Same with -Dincludes=folder2, -Dincludes=folder2/ or even when I drop "includes" entirely.
How do I get the maven-scm-plugin to add the folder first before it tries to add the files in the new directory?
I have tested this with Maven 2.2.1 and Maven 3.0.4 with scm-Plugin Versions 1.4 (the actual version in our project) and 1.6 (the latest version).
To add an existing file to a Subversion repository and put it under revision control, change to the directory with its working copy and run the following command: svn add file… Similarly, to add a directory and all files that are in it, type: svn add directory…
Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations.
The SCM Plugin offers vendor independent access to common scm commands by offering a set of command mappings for the configured scm. Each command is implemented as a goal.
SCM Connections provides innovative process design, quality implementations, and sustainable adoption for long-term supply chain forecasting methods.
I have this working with your configuration:
pom.xml (with correct scm) <- .git folder
src/folder1 <- under scm
src/folder2 (text1.txt) <- not under scm
Git project before command:
mvn org.apache.maven.plugins:maven-scm-plugin:1.12.0:add -Dbasedir=${project.basedir} -Dincludes=**/folder2/
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