mirror of
https://github.com/apache/maven.git
synced 2025-02-26 12:36:06 +00:00
allow overwriting instead of merging
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330007 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
87dc3a9e16
commit
40cbcfff05
@ -85,15 +85,15 @@ public class IdeaMojo
|
||||
*/
|
||||
private String jdkLevel;
|
||||
|
||||
/**
|
||||
* Whether to update the existing project files or overwrite them.
|
||||
* @parameter expression="${overwrite}" default-value="false"
|
||||
*/
|
||||
private boolean overwrite;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
if ( executedProject == null )
|
||||
{
|
||||
// backwards compat with alpha-2 only
|
||||
executedProject = project;
|
||||
}
|
||||
|
||||
rewriteModule();
|
||||
|
||||
if ( project.isExecutionRoot() )
|
||||
@ -118,11 +118,11 @@ private void rewriteWorkspace()
|
||||
|
||||
Reader reader = null;
|
||||
|
||||
Xpp3Dom module = null;
|
||||
Xpp3Dom module;
|
||||
|
||||
try
|
||||
{
|
||||
if ( workspaceFile.exists() )
|
||||
if ( workspaceFile.exists() && !overwrite )
|
||||
{
|
||||
reader = new FileReader( workspaceFile );
|
||||
}
|
||||
@ -167,7 +167,7 @@ private void rewriteProject()
|
||||
try
|
||||
{
|
||||
Reader reader;
|
||||
if ( projectFile.exists() )
|
||||
if ( projectFile.exists() && !overwrite )
|
||||
{
|
||||
reader = new FileReader( projectFile );
|
||||
}
|
||||
@ -255,7 +255,7 @@ private void rewriteModule()
|
||||
try
|
||||
{
|
||||
Reader reader;
|
||||
if ( moduleFile.exists() )
|
||||
if ( moduleFile.exists() && !overwrite )
|
||||
{
|
||||
reader = new FileReader( moduleFile );
|
||||
}
|
||||
@ -692,7 +692,7 @@ private Xpp3Dom findElement( Xpp3Dom component, String name )
|
||||
*/
|
||||
private void setProjectScmType( Xpp3Dom content )
|
||||
{
|
||||
String scmType = null;
|
||||
String scmType;
|
||||
|
||||
scmType = getScmType();
|
||||
|
||||
@ -713,7 +713,7 @@ private void setProjectScmType( Xpp3Dom content )
|
||||
*/
|
||||
protected String getScmType()
|
||||
{
|
||||
String scmType = null;
|
||||
String scmType;
|
||||
|
||||
if ( project.getScm() == null )
|
||||
{
|
||||
@ -732,7 +732,7 @@ protected String getScmType()
|
||||
|
||||
protected String getScmType( String connection )
|
||||
{
|
||||
String scmType = null;
|
||||
String scmType;
|
||||
|
||||
if ( connection != null )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user