Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2011-2012 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.maven.plugins.externals;
 
 import java.io.File;
 import java.util.List;
 
Examine the local working copy of a project for any svn:externals definitions. Commit any local changes including any changes under the svn:externals directories.

Goal:
commit
Aggregator:
 
 public class CommitMojo extends AbstractMojo {
 
 	SVNUtils svnUtils = SVNUtils.getInstance();

The message to associate with the commit

Parameter:
expression="${externals.commitMessage}" default-value="[externals-maven-plugin] Commit changes"
 
 	private String commitMessage;

The Maven project object

Parameter:
expression="${project}"
Readonly:
 
 	private MavenProject project;

The directory where a local working copy of the project is checked out

Parameter:
expression="${externals.workingCopy}" default-value="${project.basedir}"
 
 	private File workingCopy;
 
 	public void execute() throws MojoExecutionException {
 		List<Filedirs = new ArrayList<File>();
 		dirs.add();
 		for (SVNExternal external : externals) {
 			File dir = new File(.getAbsolutePath() + . + external.getPath());
 			if (!dir.exists()) {
 				getLog().warn(dir.getAbsolutePath() + " does not exist");
 			} else {
 				dirs.add(dir);
 			}
 		}
 		getLog().info("Committing changes in:");
 		for (File dir : dirs) {
 		}
 		SVNCommitInfo info = .commit(dirsnullnull);
 		long newRevision = info.getNewRevision();
 		if (newRevision == -1) {
 			getLog().info("No changes detected.");
 		} else {
 			getLog().info("Committed revision " + info.getNewRevision() + ".");
 		}
 	}
 
 	public String getCommitMessage() {
 		return ;
 	}
 
 	public void setCommitMessage(String commitMessage) {
 		this. = commitMessage;
 	}
 
 	public MavenProject getProject() {
 		return ;
 	}
 
 	public File getWorkingCopy() {
 		return ;
 	}
	public void setWorkingCopy(File workingCopy) {
		this. = workingCopy;
	}
New to GrepCode? Check out our FAQ X