PR: MPSCM-56
Submitted by: Dan Tran Add Starteam support, plus scm:add, scm:status, scm:checkin git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@189906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
5bb03594d4
commit
dd134e7011
9 files changed
+281
-9
No files matched your search
@@ -0,0 +1,58 @@
|
||||
package org.apache.maven.plugins.scm;
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import org.apache.maven.scm.ScmFileSet;
|
||||
import org.apache.maven.scm.command.add.AddScmResult;
|
||||
import org.apache.maven.scm.manager.ScmManager;
|
||||
import org.apache.maven.scm.repository.ScmRepository;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* A bean for using the Maven SCM API because wrangling objects in Jelly is no fun.
|
||||
*
|
||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
*/
|
||||
public class ScmAddBean extends ScmPatternBean
|
||||
{
|
||||
private String message;
|
||||
|
||||
public void add()
|
||||
throws Exception
|
||||
{
|
||||
ScmManager scmManager = lookupScmManager();
|
||||
|
||||
ScmRepository repository = getScmRepository( scmManager );
|
||||
|
||||
AddScmResult result = scmManager.add( repository, new ScmFileSet( new File( getWorkingDirectory() ), getIncludes(), getExcludes() ) );
|
||||
checkResult( result );
|
||||
}
|
||||
|
||||
public void setMessage( String message )
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.apache.maven.plugins.scm;
|
||||
import org.apache.maven.scm.ScmFileSet;
|
||||
import org.apache.maven.scm.ScmResult;
|
||||
import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
|
||||
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
|
||||
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
|
||||
import org.apache.maven.scm.command.tag.TagScmResult;
|
||||
import org.apache.maven.scm.command.update.UpdateScmResult;
|
||||
@@ -119,6 +120,23 @@ public class ScmBean
|
||||
svnRepo.setTagBase( tagBase );
|
||||
}
|
||||
}
|
||||
|
||||
if ( repository.getProvider().equals( "starteam" ) )
|
||||
{
|
||||
StarteamScmProviderRepository starteamRepo = (StarteamScmProviderRepository) repository.getProviderRepository();
|
||||
|
||||
/* TODO: reinstate when the provider supports it
|
||||
if ( username != null && username.length() > 0 )
|
||||
{
|
||||
starteamRepo.setUser( username );
|
||||
}
|
||||
if ( password != null && password.length() > 0 )
|
||||
{
|
||||
starteamRepo.setPassword( password );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return repository;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.apache.maven.plugins.scm;
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import org.apache.maven.scm.ScmFileSet;
|
||||
import org.apache.maven.scm.command.update.UpdateScmResult;
|
||||
import org.apache.maven.scm.manager.ScmManager;
|
||||
import org.apache.maven.scm.repository.ScmRepository;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* A bean for using the Maven SCM API because wrangling objects in Jelly is no fun.
|
||||
*
|
||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
*/
|
||||
public class ScmUpdateBean extends ScmPatternBean
|
||||
{
|
||||
private String message;
|
||||
|
||||
public void update()
|
||||
throws Exception
|
||||
{
|
||||
ScmManager scmManager = lookupScmManager();
|
||||
|
||||
ScmRepository repository = getScmRepository( scmManager );
|
||||
|
||||
UpdateScmResult result = scmManager.update( repository,
|
||||
new ScmFileSet( new File( getWorkingDirectory() ), getIncludes(), getExcludes() ),
|
||||
getTag() );
|
||||
checkResult( result );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user