diff --git a/src/it/projects/javadoc-fix/verify.bsh b/src/it/projects/javadoc-fix/verify.bsh index d2147bbed..526d0346a 100644 --- a/src/it/projects/javadoc-fix/verify.bsh +++ b/src/it/projects/javadoc-fix/verify.bsh @@ -60,13 +60,13 @@ try content = FileUtils.fileRead( javaFile, "UTF-8" ); assertContains( content, " *

ClassWithNoJavadoc class.

" ); - assertContains( content, " * @version $Id: $" ); assertContains( content, " * @since 1.0" ); assertContains( content, " *

main.

" ); assertContains( content, " * @param args an array of {@link java.lang.String} objects" ); // private sampleMethod assertNotContains( content, " *

sampleMethod.

" ); assertNotContains( content, " * @param str a {@link java.lang.String} object" ); + assertNotContains( content, " * @version " ); javaFile = new File( basedir, "/src/main/java/fix/test/ClassWithJavadoc.java" ); content = FileUtils.fileRead( javaFile, "UTF-8" ); @@ -93,21 +93,21 @@ try content = FileUtils.fileRead( javaFile, "UTF-8" ); assertContains( content, " *

InterfaceWithNoJavadoc interface.

" ); - assertContains( content, " * @version $Id: $" ); assertContains( content, " * @since 1.0" ); assertContains( content, " /** Constant MY_STRING_CONSTANT=\"value\" */" ); assertContains( content, " *

method.

" ); assertContains( content, " * @param aString a {@link java.lang.String} object" ); + assertNotContains( content, " * @version " ); javaFile = new File( basedir, "/src/main/java/fix/test/InterfaceWithJavadoc.java" ); content = FileUtils.fileRead( javaFile, "UTF-8" ); assertContains( content, " * Some Javadoc." ); - assertContains( content, " * @version $Id: $" ); assertContains( content, " * @since 1.0" ); assertContains( content, " /** comment */" ); assertContains( content, " * My method" ); assertContains( content, " * @param aString a {@link java.lang.String} object" ); + assertNotContains( content, " * @version " ); } catch( Throwable e ) diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java index c560e1f28..d3fa10727 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java @@ -207,11 +207,6 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo { */ public static final String JAVA_FILES = "**\\/*.java"; - /** - * Default version value. - */ - public static final String DEFAULT_VERSION_VALUE = "\u0024Id: \u0024Id"; - // ---------------------------------------------------------------------- // Mojo components // ---------------------------------------------------------------------- @@ -251,13 +246,9 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo { /** * Default value for the Javadoc tag @version. - *
- * By default, it is $Id:$, corresponding to a - * SVN keyword. - * Refer to your SCM to use an other SCM keyword. */ - @Parameter(property = "defaultVersion", defaultValue = DEFAULT_VERSION_VALUE) - private String defaultVersion = "\u0024Id: \u0024"; // can't use default-value="\u0024Id: \u0024" + @Parameter(property = "defaultVersion") + private String defaultVersion; /** * The file encoding to use when reading the source files. If the property @@ -286,7 +277,7 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo { *
  • link (fix only @link tag)
  • * */ - @Parameter(property = "fixTags", defaultValue = "all") + @Parameter(property = "fixTags", defaultValue = FIX_TAGS_ALL) private String fixTags; /** @@ -346,7 +337,7 @@ public abstract class AbstractFixJavadocMojo extends AbstractMojo { * * @see private, protected, public, package options for Javadoc */ - @Parameter(property = "level", defaultValue = "protected") + @Parameter(property = "level", defaultValue = LEVEL_PROTECTED) private String level; /** @@ -2109,7 +2100,7 @@ private void appendDefaultSinceTag(final StringBuilder sb, final String indent) * @return true if separator has been added. */ private boolean appendDefaultVersionTag(final StringBuilder sb, final String indent, boolean separatorAdded) { - if (!fixTag(VERSION_TAG)) { + if (!fixTag(VERSION_TAG) || StringUtils.isEmpty(defaultVersion)) { return separatorAdded; } @@ -2127,7 +2118,7 @@ private boolean appendDefaultVersionTag(final StringBuilder sb, final String ind * @param indent not null */ private void appendDefaultVersionTag(final StringBuilder sb, final String indent) { - if (!fixTag(VERSION_TAG)) { + if (!fixTag(VERSION_TAG) || StringUtils.isEmpty(defaultVersion)) { return; } diff --git a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java index c5a6ba3fd..145a71e3b 100644 --- a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java +++ b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithJavadoc.java @@ -23,7 +23,6 @@ * To add default class tags. * * @author vsiveton@apache.org - * @version $Id: $ */ @SuppressWarnings("SameReturnValue") public class ClassWithJavadoc diff --git a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithNoJavadoc.java b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithNoJavadoc.java index 44d869e19..c37994ca0 100644 --- a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithNoJavadoc.java +++ b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/ClassWithNoJavadoc.java @@ -25,7 +25,6 @@ *

    ClassWithNoJavadoc class.

    * * @author vsiveton@apache.org - * @version $Id: $ */ @SuppressWarnings("SameReturnValue") public class ClassWithNoJavadoc diff --git a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithJavadoc.java b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithJavadoc.java index 89bdf0653..55ce1be4a 100644 --- a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithJavadoc.java +++ b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithJavadoc.java @@ -23,7 +23,6 @@ * To add default interface tags. * * @author vsiveton@apache.org - * @version $Id: $ */ public interface InterfaceWithJavadoc { diff --git a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithNoJavadoc.java b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithNoJavadoc.java index 0ec11c0af..6f25c7053 100644 --- a/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithNoJavadoc.java +++ b/src/test/resources/unit/fix-test/expected/src/main/java/fix/test/InterfaceWithNoJavadoc.java @@ -23,7 +23,6 @@ *

    InterfaceWithNoJavadoc interface.

    * * @author vsiveton@apache.org - * @version $Id: $ */ public interface InterfaceWithNoJavadoc {