Skip to content

Commit

Permalink
simplify keepCommentsInPom boolean. mojohaus#270
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-stefan-cordes committed Aug 8, 2022
1 parent 948df1c commit e8c418c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java
Expand Up @@ -375,7 +375,7 @@ public class FlattenMojo
* @since 1.2.8
*/
@Parameter( property = "flatten.dependency.keepComments", required = false , defaultValue = "false")
private Boolean keepCommentsInPom;
private boolean keepCommentsInPom;

@Component
private DependencyResolver dependencyResolver;
Expand Down Expand Up @@ -408,7 +408,7 @@ public void execute()

File originalPomFile = this.project.getFile();
KeepCommentsInPom commentsOfOriginalPomFile = null;
if (isKeepCommentsInPom()) {
if (keepCommentsInPom) {
commentsOfOriginalPomFile = KeepCommentsInPom.create(getLog(), originalPomFile);
}
Model flattenedPom = createFlattenedPom( originalPomFile );
Expand Down Expand Up @@ -1264,23 +1264,6 @@ public boolean isUpdatePomFile()
}
}

/**
* @return <code>true</code> if the generated flattened POM shall have the comments of the original file
* <code>false</code> will remove the comments.
*/
public boolean isKeepCommentsInPom()
{

if ( this.keepCommentsInPom == null )
{
return false;
}
else
{
return this.keepCommentsInPom.booleanValue();
}
}

/**
* This class is a simple SAX handler that extracts the first comment located before the root tag in an XML
* document.
Expand Down

0 comments on commit e8c418c

Please sign in to comment.