From 0b900141cba0f84a7ee1a032daf7349fcc23fba4 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Wed, 24 Jun 2020 12:40:41 +0200 Subject: [PATCH] Fixes #413 - fix maven site generation (#414) fix javadoc errors exclude modello-generated classes from javadocs remove plugin dependencies already defined (with newer versions) in parent pom --- pom.xml | 32 +++++++------------ ...AbstractVersionsDependencyUpdaterMojo.java | 23 ++++++------- .../mojo/versions/AbstractVersionsReport.java | 4 ++- .../versions/AbstractVersionsUpdaterMojo.java | 10 +++--- .../versions/CompareDependenciesMojo.java | 2 -- .../DependencyUpdatesXmlRenderer.java | 2 +- .../versions/api/DefaultVersionsHelper.java | 3 +- .../codehaus/mojo/versions/api/PomHelper.java | 4 +-- .../mojo/versions/api/UpdateScope.java | 15 +++++---- .../mojo/versions/api/VersionDetails.java | 12 +++---- .../mojo/versions/api/VersionsHelper.java | 5 +++ .../rewriting/ModifiedPomXMLEventReader.java | 2 +- 12 files changed, 58 insertions(+), 56 deletions(-) diff --git a/pom.xml b/pom.xml index 81d915ea3..6a2d88e30 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ 1.9.1 1.7 ${project.version} - 3.6 + 3.7 @@ -267,21 +267,6 @@ modello-maven-plugin 1.11 - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.14 - - - org.apache.maven.plugins - maven-site-plugin - 3.6 - @@ -412,6 +397,16 @@ -Xmx256m + + maven-javadoc-plugin + + + + org.codehaus.mojo.versions.model, + org.codehaus.mojo.versions.model.io.xpp3 + + + @@ -448,11 +443,6 @@ - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - diff --git a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDependencyUpdaterMojo.java b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDependencyUpdaterMojo.java index 61b8ad2d2..780cec259 100644 --- a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDependencyUpdaterMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsDependencyUpdaterMojo.java @@ -141,7 +141,7 @@ public abstract class AbstractVersionsDependencyUpdaterMojo /** * Should the project/dependencies section of the pom be processed. * - * @return returns true if the project/dependencies section of the pom should be processed. + * @return returns true if the project/dependencies section of the pom should be processed. * @since 1.0-alpha-3 */ public boolean isProcessingDependencies() @@ -152,7 +152,7 @@ public boolean isProcessingDependencies() /** * Should the project/dependencyManagement section of the pom be processed. * - * @return returns true if the project/dependencyManagement section of the pom should be processed. + * @return returns true if the project/dependencyManagement section of the pom should be processed. * @since 1.0-alpha-3 */ public boolean isProcessingDependencyManagement() @@ -163,7 +163,7 @@ public boolean isProcessingDependencyManagement() /** * Should the project/parent section of the pom be processed. * - * @return returns true if the project/parent section of the pom should be processed. + * @return returns true if the project/parent section of the pom should be processed. * @since 2.3 */ public boolean isProcessingParent() @@ -174,7 +174,7 @@ public boolean isProcessingParent() /** * Should the artifacts produced in the current reactor be excluded from processing. * - * @return returns true if the artifacts produced in the current reactor should be excluded from processing. + * @return returns true if the artifacts produced in the current reactor should be excluded from processing. * @since 1.0-alpha-3 */ public boolean isExcludeReactor() @@ -185,7 +185,7 @@ public boolean isExcludeReactor() /** * Should the dependency be updated itself or is it handled by properties. * - * @param dependency + * @param dependency Dependency * @return true if the version starts with '${' * @since 2.8 */ @@ -197,8 +197,8 @@ protected boolean isHandledByProperty(Dependency dependency) { /** * Try to find the dependency artifact that matches the given dependency. * - * @param dependency - * @return + * @param dependency Dependency + * @return Artifact * @since 1.0-alpha-3 */ protected Artifact findArtifact( Dependency dependency ) @@ -222,8 +222,9 @@ protected Artifact findArtifact( Dependency dependency ) /** * Try to find the dependency artifact that matches the given dependency. * - * @param dependency - * @return + * @param dependency Dependency + * @throws MojoExecutionException Mojo execution exception + * @return Artifact * @since 1.0-alpha-3 */ protected Artifact toArtifact( Dependency dependency ) @@ -344,8 +345,8 @@ private boolean compare( MavenProject project, Dependency dep ) * Compare and artifact to a dependency. Returns true only if the groupId, artifactId, type, and classifier are all * equal. * - * @param artifact - * @param dep + * @param artifact Artifact + * @param dep Dependency * @return true if artifact and dep refer to the same artifact */ private boolean compare( Artifact artifact, Dependency dep ) diff --git a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsReport.java b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsReport.java index 7841d9f6b..88b29b3bc 100644 --- a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsReport.java +++ b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsReport.java @@ -253,6 +253,7 @@ protected void executeReport( Locale locale ) * @param locale the locale to generate the report for. * @param sink the report formatting tool. * @throws MavenReportException when things go wrong. + * @throws MojoExecutionException if something goes wrong. */ protected abstract void doGenerateReport( Locale locale, Sink sink ) throws MavenReportException, MojoExecutionException; @@ -263,9 +264,10 @@ protected abstract void doGenerateReport( Locale locale, Sink sink ) * @param artifact The artifact. * @param versionRange The version range. * @param allowingSnapshots null for no override, otherwise the local override to apply. + * @param usePluginRepositories Use plugin repositories * @return The latest version of the specified artifact that matches the specified version range or * null if no matching version could be found. - * @throws MojoExecutionException If the artifact metadata could not be found. + * @throws MavenReportException If the artifact metadata could not be found. * @since 1.0-alpha-1 */ protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange, diff --git a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsUpdaterMojo.java b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsUpdaterMojo.java index 26cc7b058..8babe9d49 100644 --- a/src/main/java/org/codehaus/mojo/versions/AbstractVersionsUpdaterMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/AbstractVersionsUpdaterMojo.java @@ -258,10 +258,11 @@ public void execute() * @param artifact The artifact. * @param versionRange The version range. * @param allowingSnapshots null for no override, otherwise the local override to apply. - * @param usePluginRepositories + * @param usePluginRepositories Use plugin repositories * @return The latest version of the specified artifact that matches the specified version range or * null if no matching version could be found. * @throws ArtifactMetadataRetrievalException If the artifact metadata could not be found. + * @throws MojoExecutionException if something goes wrong. * @since 1.0-alpha-1 */ protected ArtifactVersion findLatestVersion( Artifact artifact, VersionRange versionRange, @@ -401,6 +402,7 @@ protected final void writeFile( File outFile, StringBuilder input ) * @throws MojoExecutionException If things go wrong. * @throws MojoFailureException If things go wrong. * @throws javax.xml.stream.XMLStreamException If things go wrong. + * @throws ArtifactMetadataRetrievalException if something goes wrong. * @since 1.0-alpha-1 */ protected abstract void update( ModifiedPomXMLEventReader pom ) @@ -453,9 +455,9 @@ protected boolean shouldApplyUpdate( Artifact artifact, String currentVersion, A * Based on the passed flags, determines which segment is unchangable. This can be used when determining an upper * bound for the "latest" version. * - * @param allowMajorUpdates - * @param allowMinorUpdates - * @param allowIncrementalUpdates + * @param allowMajorUpdates Allow major updates + * @param allowMinorUpdates Allow minor updates + * @param allowIncrementalUpdates Allow incremental updates * @return Returns the segment that is unchangable. If any segment can change, returns -1. */ protected int determineUnchangedSegment( boolean allowMajorUpdates, boolean allowMinorUpdates, diff --git a/src/main/java/org/codehaus/mojo/versions/CompareDependenciesMojo.java b/src/main/java/org/codehaus/mojo/versions/CompareDependenciesMojo.java index 4a5625d0a..c50ba5fcf 100644 --- a/src/main/java/org/codehaus/mojo/versions/CompareDependenciesMojo.java +++ b/src/main/java/org/codehaus/mojo/versions/CompareDependenciesMojo.java @@ -91,8 +91,6 @@ public class CompareDependenciesMojo /** * Update dependency versions stored in properties - * - * @parameter property="updatePropertyVersions" default-value="false" */ @Parameter( property = "updatePropertyVersions", defaultValue = "false" ) protected boolean updatePropertyVersions; diff --git a/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesXmlRenderer.java b/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesXmlRenderer.java index b58c7f87f..90a2cb284 100644 --- a/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesXmlRenderer.java +++ b/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesXmlRenderer.java @@ -117,7 +117,7 @@ public void render() /** * Method wraps value in xml tag. In ex: to wrap foo in tag bar you have to pass foo as value and bar as tag. As a - * result you will get: foo + * result you will get: <bar>foo</bar> * * @param value - string to wrap * @param tag - name of tag diff --git a/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java b/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java index f40ba461e..46a82f7a8 100644 --- a/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java +++ b/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java @@ -180,7 +180,7 @@ public class DefaultVersionsHelper * Constructs a new {@link DefaultVersionsHelper}. * * @param artifactFactory The artifact factory. - * @param artifactResolver + * @param artifactResolver Artifact resolver * @param artifactMetadataSource The artifact metadata source to use. * @param remoteArtifactRepositories The remote artifact repositories to consult. * @param remotePluginRepositories The remote plugin repositories to consult. @@ -193,6 +193,7 @@ public class DefaultVersionsHelper * @param mavenSession The maven session information. * @param pathTranslator The path translator component. @throws org.apache.maven.plugin.MojoExecutionException If * things go wrong. + * @throws MojoExecutionException if something goes wrong. * @since 1.0-alpha-3 */ public DefaultVersionsHelper( ArtifactFactory artifactFactory, ArtifactResolver artifactResolver, diff --git a/src/main/java/org/codehaus/mojo/versions/api/PomHelper.java b/src/main/java/org/codehaus/mojo/versions/api/PomHelper.java index fe4382ff7..4b73fc30d 100644 --- a/src/main/java/org/codehaus/mojo/versions/api/PomHelper.java +++ b/src/main/java/org/codehaus/mojo/versions/api/PomHelper.java @@ -1572,9 +1572,9 @@ public static String getGAV( Model model ) /** * Reads imported POMs from the dependency management section. * - * @param pom + * @param pom POM * @return a non-null list of {@link Dependency} for each imported POM - * @throws XMLStreamException + * @throws XMLStreamException XML stream exception * @see bug #134 * @since 2.4 */ diff --git a/src/main/java/org/codehaus/mojo/versions/api/UpdateScope.java b/src/main/java/org/codehaus/mojo/versions/api/UpdateScope.java index fbef134e7..053946b7f 100644 --- a/src/main/java/org/codehaus/mojo/versions/api/UpdateScope.java +++ b/src/main/java/org/codehaus/mojo/versions/api/UpdateScope.java @@ -34,7 +34,7 @@ * Scopes of version updates. * * @author Stephen Connolly - * @todo convert this class to a Java 1.5 enum once we move to Java 1.5 + * todo: convert this class to a Java 1.5 enum once we move to Java 1.5 * @since 1.0-beta-1 */ public abstract class UpdateScope @@ -246,7 +246,6 @@ public ArtifactVersion[] getAllUpdates( VersionDetails versionDetails, ArtifactV * @param currentVersion The current version. * @param includeSnapshots Whether to include snapshots. * @return The next version within this scope or null if there is no version within this scope. - * @throws ArtifactMetadataRetrievalException if there was a problem retrieving the list of available versions. */ public abstract ArtifactVersion getOldestUpdate( VersionDetails versionDetails, ArtifactVersion currentVersion, boolean includeSnapshots ); @@ -281,10 +280,11 @@ public abstract ArtifactVersion[] getAllUpdates( VersionDetails versionDetails, /** * Returns the name of this enum constant, exactly as declared in its enum declaration. - *

+ *

* Most programmers should use the {@link #toString} method in preference to this one, as the toString method may * return a more user-friendly name. This method is designed primarily for use in specialized situations where * correctness depends on getting the exact name, which will not vary from release to release. + *

* * @return the name of this enum constant */ @@ -296,16 +296,18 @@ public final String name() /** * The ordinal of this enumeration constant (its position in the enum declaration, where the initial constant is * assigned an ordinal of zero). - *

+ *

* Most programmers will have no use for this field. + *

*/ private final int ordinal; /** * Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial * constant is assigned an ordinal of zero). - *

+ *

* Most programmers will have no use for this method. + *

* * @return the ordinal of this enumeration constant */ @@ -366,9 +368,10 @@ protected final Object clone() /** * Compares this enum with the specified object for order. Returns a negative integer, zero, or a positive integer * as this object is less than, equal to, or greater than the specified object. - *

+ *

* Enum constants are only comparable to other enum constants of the same enum type. The natural order implemented * by this method is the order in which the constants are declared. + *

*/ public final int compareTo( Object o ) { diff --git a/src/main/java/org/codehaus/mojo/versions/api/VersionDetails.java b/src/main/java/org/codehaus/mojo/versions/api/VersionDetails.java index 7b3a1b506..144121e52 100644 --- a/src/main/java/org/codehaus/mojo/versions/api/VersionDetails.java +++ b/src/main/java/org/codehaus/mojo/versions/api/VersionDetails.java @@ -103,7 +103,7 @@ public interface VersionDetails * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return all available versions within the specified version range. * @since 1.0-beta-1 */ @@ -119,7 +119,7 @@ ArtifactVersion[] getVersions( ArtifactVersion lowerBound, ArtifactVersion upper * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return all available versions within the specified version range. * @since 1.0-beta-1 */ @@ -158,7 +158,7 @@ ArtifactVersion getNewestVersion( ArtifactVersion lowerBound, ArtifactVersion up * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return the latest version between lowerBound and upperBound or null if no version is available. * @since 1.0-alpha-3 */ @@ -175,7 +175,7 @@ ArtifactVersion getNewestVersion( ArtifactVersion lowerBound, ArtifactVersion up * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return the latest version between lowerBound and upperBound or null if no version is available. * @since 1.0-alpha-3 */ @@ -233,7 +233,7 @@ ArtifactVersion getOldestVersion( ArtifactVersion lowerBound, ArtifactVersion up * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return the oldest version between lowerBound and upperBound or null if no version is available. * @since 1.0-beta-1 */ @@ -249,7 +249,7 @@ ArtifactVersion getOldestVersion( ArtifactVersion lowerBound, ArtifactVersion up * @param upperBound the upper bound or null if the upper limit is unbounded. * @param includeSnapshots true if snapshots are to be included. * @param includeLower true if the lower bound is inclusive. - * @param includeUpper true> if the upper bound is inclusive. + * @param includeUpper true if the upper bound is inclusive. * @return the oldest version between lowerBound and upperBound or null if no version is available. * @since 1.0-beta-1 */ diff --git a/src/main/java/org/codehaus/mojo/versions/api/VersionsHelper.java b/src/main/java/org/codehaus/mojo/versions/api/VersionsHelper.java index 734fb1998..a72c395dd 100644 --- a/src/main/java/org/codehaus/mojo/versions/api/VersionsHelper.java +++ b/src/main/java/org/codehaus/mojo/versions/api/VersionsHelper.java @@ -190,6 +190,7 @@ ArtifactVersions lookupArtifactUpdates( Artifact artifact, boolean allowSnapshot * @param usePluginRepositories Search the plugin repositories. * @return A map, keyed by dependency, with values of type {@link org.codehaus.mojo.versions.api.ArtifactVersions}. * @throws ArtifactMetadataRetrievalException When things go wrong. + * @throws InvalidVersionSpecificationException if something goes wrong. * @since 1.0-beta-1 */ Map lookupDependenciesUpdates( Set dependencies, @@ -203,6 +204,7 @@ Map lookupDependenciesUpdates( Set dep * @param usePluginRepositories Search the plugin repositories. * @return The details of updates to the dependency. * @throws ArtifactMetadataRetrievalException When things go wrong. + * @throws InvalidVersionSpecificationException if something goes wrong. * @since 1.0-beta-1 */ ArtifactVersions lookupDependencyUpdates( Dependency dependency, boolean usePluginRepositories ) @@ -215,6 +217,7 @@ ArtifactVersions lookupDependencyUpdates( Dependency dependency, boolean usePlug * @param allowSnapshots Include snapshots in the list of updates. * @return A map, keyed by plugin, with values of type {@link org.codehaus.mojo.versions.PluginUpdatesDetails}. * @throws ArtifactMetadataRetrievalException When things go wrong. + * @throws InvalidVersionSpecificationException if something goes wrong. * @since 1.0-beta-1 */ Map lookupPluginsUpdates( Set plugins, boolean allowSnapshots ) @@ -266,6 +269,8 @@ Map getVersionPropertiesMap( MavenProject project, P * * @param artifact The artifact to resolve. * @param usePluginRepositories whether to resolve from the plugin repositories or the regular repositories. + * @throws ArtifactResolutionException if something goes wrong. + * @throws ArtifactNotFoundException if something goes wrong. * @since 1.3 */ void resolveArtifact( Artifact artifact, boolean usePluginRepositories ) diff --git a/src/main/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReader.java b/src/main/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReader.java index a742aa583..f8fdd3529 100644 --- a/src/main/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReader.java +++ b/src/main/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReader.java @@ -34,7 +34,7 @@ /** * Represents the modified pom file. Note: implementations of the StAX API (JSR-173) are not good round-trip rewriting * while keeping all unchanged bytes in the file as is. For example, the StAX API specifies that CR - * characters will be stripped. Current implementations do not keep " and ' characters consistent. + * characters will be stripped. Current implementations do not keep " and ' characters consistent. * * @author Stephen Connolly */