Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add files in new directories with maven scm:add command in subversion?

Tags:

java

svn

maven

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).

like image 810
Marc von Renteln Avatar asked Mar 01 '12 15:03

Marc von Renteln


People also ask

How do I add files to SVN?

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…

What is Maven scm used for?

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.

What is Maven scm plugin?

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.

What is scm connection?

SCM Connections provides innovative process design, quality implementations, and sustainable adoption for long-term supply chain forecasting methods.


1 Answers

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:
enter image description here

Solution

mvn org.apache.maven.plugins:maven-scm-plugin:1.12.0:add -Dbasedir=${project.basedir} -Dincludes=**/folder2/

Result

enter image description here

enter image description here

like image 140
Simple Learner Avatar answered Nov 14 '22 23:11

Simple Learner