-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added ScmCommentPrefix configuration
- added rollback feature in release-manager - added release:rollback mojo - also updated the site docs/apt git-svn-id: https://svn.apache.org/repos/asf/maven/release/trunk/maven-release-manager@492945 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Edwin L. Punzalan
committed
Jan 5, 2007
1 parent
c705c91
commit de9aad0
Showing
33 changed files
with
1,348 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.apache.maven.shared.release.phase; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.project.MavenProject; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* @author Edwin Punzalan | ||
*/ | ||
public abstract class AbstractBackupPomsPhase | ||
extends AbstractReleasePhase | ||
{ | ||
private final String backupPrefix = ".releaseBackup"; | ||
|
||
protected File getPomBackup( MavenProject project ) | ||
{ | ||
File pomFile = project.getFile(); | ||
|
||
return new File( pomFile.getAbsolutePath() + backupPrefix ); | ||
} | ||
|
||
protected void deletePomBackup( MavenProject project ) | ||
{ | ||
File pomBackup = getPomBackup( project ); | ||
|
||
if ( pomBackup.exists() ) | ||
{ | ||
pomBackup.delete(); | ||
} | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package org.apache.maven.shared.release.phase; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.shared.release.ReleaseResult; | ||
import org.apache.maven.shared.release.ReleaseExecutionException; | ||
import org.apache.maven.shared.release.ReleaseFailureException; | ||
import org.apache.maven.shared.release.config.ReleaseDescriptor; | ||
import org.apache.maven.settings.Settings; | ||
import org.apache.maven.project.MavenProject; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
import java.util.List; | ||
import java.util.Iterator; | ||
import java.io.IOException; | ||
|
||
/** | ||
* @author Edwin Punzalan | ||
*/ | ||
public class CreateBackupPomsPhase | ||
extends AbstractBackupPomsPhase | ||
{ | ||
public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects ) | ||
throws ReleaseExecutionException, ReleaseFailureException | ||
{ | ||
ReleaseResult result = new ReleaseResult(); | ||
|
||
//remove previous backups, if any | ||
clean( reactorProjects ); | ||
|
||
for( Iterator projects = reactorProjects.iterator(); projects.hasNext(); ) | ||
{ | ||
MavenProject project = (MavenProject) projects.next(); | ||
|
||
createPomBackup( project ); | ||
} | ||
|
||
result.setResultCode( ReleaseResult.SUCCESS ); | ||
|
||
return result; | ||
} | ||
|
||
public ReleaseResult clean( List reactorProjects ) | ||
{ | ||
ReleaseResult result = new ReleaseResult(); | ||
|
||
for( Iterator projects = reactorProjects.iterator(); projects.hasNext(); ) | ||
{ | ||
MavenProject project = (MavenProject) projects.next(); | ||
|
||
deletePomBackup( project ); | ||
} | ||
|
||
result.setResultCode( ReleaseResult.SUCCESS ); | ||
|
||
return result; | ||
} | ||
|
||
public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects ) | ||
throws ReleaseExecutionException, ReleaseFailureException | ||
{ | ||
return execute( releaseDescriptor, settings, reactorProjects ); | ||
} | ||
|
||
private void createPomBackup( MavenProject project ) | ||
throws ReleaseExecutionException | ||
{ | ||
//delete any existing backup first | ||
deletePomBackup( project ); | ||
|
||
try | ||
{ | ||
FileUtils.copyFile( project.getFile(), getPomBackup( project ) ); | ||
} | ||
catch ( IOException e ) | ||
{ | ||
throw new ReleaseExecutionException( "Error creating backup POM: " + e.getMessage(), e ); | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/org/apache/maven/shared/release/phase/RemoveScmTagPhase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.apache.maven.shared.release.phase; | ||
|
||
import org.apache.maven.shared.release.ReleaseResult; | ||
import org.apache.maven.shared.release.ReleaseExecutionException; | ||
import org.apache.maven.shared.release.ReleaseFailureException; | ||
import org.apache.maven.shared.release.config.ReleaseDescriptor; | ||
import org.apache.maven.settings.Settings; | ||
|
||
import java.util.List; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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. | ||
*/ | ||
|
||
/** | ||
* @author Edwin Punzalan | ||
*/ | ||
public class RemoveScmTagPhase | ||
extends AbstractReleasePhase | ||
{ | ||
public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects ) | ||
throws ReleaseExecutionException, ReleaseFailureException | ||
{ | ||
ReleaseResult result = new ReleaseResult(); | ||
|
||
// TODO [!]: implement | ||
|
||
result.setResultCode( ReleaseResult.SUCCESS ); | ||
|
||
return result; | ||
} | ||
|
||
public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects ) | ||
throws ReleaseExecutionException, ReleaseFailureException | ||
{ | ||
return execute( releaseDescriptor, settings, reactorProjects ); | ||
} | ||
} |
Oops, something went wrong.