Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 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>();
		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