This is an automated email from the ASF dual-hosted git repository. olamy pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
The following commit(s) were added to refs/heads/master by this push: new c74b8df4 Bump org.apache.maven.plugins:maven-plugins from 43 to 44 (#361) c74b8df4 is described below commit c74b8df4f3d69018f8db52324db300f8abc47a5d Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> AuthorDate: Mon Jun 2 21:08:15 2025 +1000 Bump org.apache.maven.plugins:maven-plugins from 43 to 44 (#361) * Bump org.apache.maven.plugins:maven-plugins from 43 to 44 Bumps [org.apache.maven.plugins:maven-plugins](https://github.com/apache/maven-parent) from 43 to 44. - [Release notes](https://github.com/apache/maven-parent/releases) - [Commits](https://github.com/apache/maven-parent/commits/v44) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-plugins dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <supp...@github.com> * fix parent upgrade Signed-off-by: Olivier Lamy <ol...@apache.org> --------- Signed-off-by: dependabot[bot] <supp...@github.com> Signed-off-by: Olivier Lamy <ol...@apache.org> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Olivier Lamy <ol...@apache.org> --- pom.xml | 3 +- .../javadoc/AbstractFixJavadocMojoTest.java | 20 ++++----- .../plugins/javadoc/AbstractJavadocMojoTest.java | 4 +- .../javadoc/AggregatorJavadocReportTest.java | 6 +-- .../maven/plugins/javadoc/FixJavadocMojoTest.java | 6 +-- .../maven/plugins/javadoc/JavadocUtilTest.java | 50 ++++++---------------- .../apache/maven/plugins/javadoc/ProxyServer.java | 17 +++++--- 7 files changed, 45 insertions(+), 61 deletions(-) diff --git a/pom.xml b/pom.xml index 842364c8..e79e3405 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. <parent> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugins</artifactId> - <version>43</version> + <version>44</version> <relativePath /> </parent> @@ -173,6 +173,7 @@ under the License. <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> + <version>3.15.1</version> <scope>provided</scope> </dependency> <dependency> diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojoTest.java index 9ac6415b..ab545e61 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojoTest.java @@ -33,7 +33,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_noLinkTag() { + public void testReplaceLinkTagsNoLinkTag() { String comment = "/** @see ConnectException */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class NoLinkTag {}"; @@ -45,7 +45,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_oneLinkTag() { + public void testReplaceLinkTagsOneLinkTag() { String comment = "/** {@link ConnectException} */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class OneLinkTag {}"; @@ -56,7 +56,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_missingEndBrace() { + public void testReplaceLinkTagsMissingEndBrace() { String comment = "/** {@link ConnectException */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class MissingEndBrace {}"; @@ -67,7 +67,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_spacesAfterLinkTag() { + public void testReplaceLinkTagsSpacesAfterLinkTag() { String comment = "/** {@link ConnectException} */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class SpacesAfterLinkTag {}"; @@ -78,7 +78,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_spacesAfterClassName() { + public void testReplaceLinkTagsSpacesAfterClassName() { String comment = "/** {@link ConnectException } */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class SpacesAfterClassName {}"; @@ -89,7 +89,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_spacesAfterMethod() { + public void testReplaceLinkTagsSpacesAfterMethod() { String comment = "/** {@link ConnectException#getMessage() } */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class SpacesAfterMethod {}"; @@ -100,7 +100,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_containingHash() { + public void testReplaceLinkTagsContainingHash() { String comment = "/** {@link ConnectException#getMessage()} */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class ContainingHashes {}"; @@ -111,7 +111,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_followedByHash() { + public void testReplaceLinkTagsFollowedByHash() { String comment = "/** {@link ConnectException} ##important## */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class FollowedByHash {}"; @@ -122,7 +122,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_twoLinks() { + public void testReplaceLinkTagsTwoLinks() { String comment = "/** Use {@link ConnectException} instead of {@link Exception} */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class TwoLinks {}"; @@ -134,7 +134,7 @@ public class AbstractFixJavadocMojoTest { } @Test - public void testReplaceLinkTags_OnlyAnchor() { + public void testReplaceLinkTagsOnlyAnchor() { String comment = "/** There's a {@link #getClass()} but no setClass() */"; String source = "import java.net.ConnectException;\n" + comment + "\n" + "public class OnlyAnchor {}"; diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java index d21ba29d..323b41f7 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java @@ -44,7 +44,7 @@ public class AbstractJavadocMojoTest { } @Test - public void testMJAVADOC432_DetectLinksMessages() { + public void testMJAVADOC432DetectLinksMessages() { Log log = mock(Log.class); when(log.isErrorEnabled()).thenReturn(true); mojo.setLog(log); @@ -69,7 +69,7 @@ public class AbstractJavadocMojoTest { } @Test - public void testMJAVADOC527_DetectLinksRecursion() { + public void testMJAVADOC527DetectLinksRecursion() { Log log = mock(Log.class); when(log.isErrorEnabled()).thenReturn(true); mojo.setLog(log); diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java index c394905d..f32413fa 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java @@ -41,7 +41,7 @@ public class AggregatorJavadocReportTest extends AbstractMojoTestCase { private static final char LINE_SEPARATOR = ' '; /** flag to copy repo only one time */ - private static boolean TEST_REPO_CREATED = false; + private static boolean testRepoCreated = false; private File unit; @@ -88,7 +88,7 @@ public class AggregatorJavadocReportTest extends AbstractMojoTestCase { * @throws IOException if any */ private void createTestRepo() throws IOException { - if (TEST_REPO_CREATED) { + if (testRepoCreated) { return; } @@ -148,7 +148,7 @@ public class AggregatorJavadocReportTest extends AbstractMojoTestCase { } } - TEST_REPO_CREATED = true; + testRepoCreated = true; } /** diff --git a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java index b9ad5ab9..74caa8c6 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java @@ -53,7 +53,7 @@ public class FixJavadocMojoTest extends AbstractMojoTestCase { private static final String EOL = System.getProperty("line.separator"); /** flag to copy repo only one time */ - private static boolean TEST_REPO_CREATED = false; + private static boolean testRepoCreated = false; /** {@inheritDoc} */ @Override @@ -69,7 +69,7 @@ public class FixJavadocMojoTest extends AbstractMojoTestCase { * @throws IOException if any */ private void createTestRepo() throws Exception { - if (TEST_REPO_CREATED) { + if (testRepoCreated) { return; } @@ -97,7 +97,7 @@ public class FixJavadocMojoTest extends AbstractMojoTestCase { } } - TEST_REPO_CREATED = true; + testRepoCreated = true; } /** diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java index df6fcd99..e15b2f21 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java @@ -61,7 +61,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class JavadocUtilTest extends PlexusTestCase { - public void testParseJavadocVersion_Null() { + public void testParseJavadocVersionNull() { try { JavadocUtil.extractJavadocVersion(null); fail("Not catch null"); @@ -70,7 +70,7 @@ public class JavadocUtilTest extends PlexusTestCase { } } - public void testParseJavadocVersion_EmptyString() { + public void testParseJavadocVersionEmptyString() { try { JavadocUtil.extractJavadocVersion(""); fail("Not catch empty version"); @@ -163,7 +163,7 @@ public class JavadocUtilTest extends PlexusTestCase { assertEquals("10.0.1", JavadocUtil.extractJavadocVersion(version)); } - public void testParseJavadocMemory_null() { + public void testParseJavadocMemoryNull() { try { JavadocUtil.parseJavadocMemory(null); fail("Not catch null"); @@ -172,7 +172,7 @@ public class JavadocUtilTest extends PlexusTestCase { } } - public void testParseJavadocMemory_empty() { + public void testParseJavadocMemoryEmpty() { try { JavadocUtil.parseJavadocMemory(""); fail("Not catch null"); @@ -291,35 +291,24 @@ public class JavadocUtilTest extends PlexusTestCase { } // real proxy - ProxyServer proxyServer = null; - AuthAsyncProxyServlet proxyServlet; - try { - proxyServlet = new AuthAsyncProxyServlet(); - proxyServer = new ProxyServer(proxyServlet); + AuthAsyncProxyServlet proxyServlet = new AuthAsyncProxyServlet(); + try (ProxyServer proxyServer = new ProxyServer(proxyServlet)) { proxyServer.start(); - settings = new Settings(); - assertTrue(JavadocUtil.isValidPackageList(url, settings, true)); - try { JavadocUtil.isValidPackageList(wrongUrl, settings, false); fail(); } catch (IOException e) { assertTrue(true); } - } finally { - if (proxyServer != null) { - proxyServer.stop(); - } } Map<String, String> authentications = new HashMap<>(); authentications.put("foo", "bar"); // wrong auth - try { - proxyServlet = new AuthAsyncProxyServlet(authentications); - proxyServer = new ProxyServer(proxyServlet); + proxyServlet = new AuthAsyncProxyServlet(authentications); + try (ProxyServer proxyServer = new ProxyServer(proxyServlet)) { proxyServer.start(); settings = new Settings(); @@ -334,14 +323,11 @@ public class JavadocUtilTest extends PlexusTestCase { fail(); } catch (FileNotFoundException e) { assertTrue(true); - } finally { - proxyServer.stop(); } // auth proxy - try { - proxyServlet = new AuthAsyncProxyServlet(authentications); - proxyServer = new ProxyServer(proxyServlet); + proxyServlet = new AuthAsyncProxyServlet(authentications); + try (ProxyServer proxyServer = new ProxyServer(proxyServlet)) { proxyServer.start(); settings = new Settings(); @@ -362,14 +348,11 @@ public class JavadocUtilTest extends PlexusTestCase { } catch (IOException e) { assertTrue(true); } - } finally { - proxyServer.stop(); } // timeout - try { - proxyServlet = new AuthAsyncProxyServlet(authentications, 3000); // more than 2000, see fetchURL - proxyServer = new ProxyServer(proxyServlet); + proxyServlet = new AuthAsyncProxyServlet(authentications, 3000); // more than 2000, see fetchURL + try (ProxyServer proxyServer = new ProxyServer(proxyServlet)) { proxyServer.start(); settings = new Settings(); @@ -386,14 +369,11 @@ public class JavadocUtilTest extends PlexusTestCase { fail(); } catch (SocketTimeoutException e) { assertTrue(true); - } finally { - proxyServer.stop(); } // nonProxyHosts - try { - proxyServlet = new AuthAsyncProxyServlet(authentications); - proxyServer = new ProxyServer(proxyServlet); + proxyServlet = new AuthAsyncProxyServlet(authentications); + try (ProxyServer proxyServer = new ProxyServer(proxyServlet)) { proxyServer.start(); settings = new Settings(); @@ -408,8 +388,6 @@ public class JavadocUtilTest extends PlexusTestCase { settings.addProxy(proxy); assertTrue(JavadocUtil.isValidPackageList(url, settings, true)); - } finally { - proxyServer.stop(); } } diff --git a/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java b/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java index 0425a668..745667e7 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java @@ -43,7 +43,7 @@ import org.eclipse.jetty.servlet.ServletHolder; * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> * @since 2.6 */ -class ProxyServer { +class ProxyServer implements AutoCloseable { private Server proxyServer; private ServerConnector serverConnector; @@ -51,7 +51,7 @@ class ProxyServer { /** * @param proxyServlet the wanted auth proxy servlet */ - public ProxyServer(AuthAsyncProxyServlet proxyServlet) { + ProxyServer(AuthAsyncProxyServlet proxyServlet) { this(null, 0, proxyServlet); } @@ -60,7 +60,7 @@ class ProxyServer { * @param port the server port * @param proxyServlet the wanted auth proxy servlet */ - public ProxyServer(String hostName, int port, AuthAsyncProxyServlet proxyServlet) { + ProxyServer(String hostName, int port, AuthAsyncProxyServlet proxyServlet) { proxyServer = new Server(); serverConnector = new ServerConnector(proxyServer); @@ -105,6 +105,11 @@ class ProxyServer { } } + @Override + public void close() throws Exception { + this.stop(); + } + /** * @throws Exception if any */ @@ -126,7 +131,7 @@ class ProxyServer { /** * Constructor for non authentication servlet. */ - public AuthAsyncProxyServlet() { + AuthAsyncProxyServlet() { super(); } @@ -135,7 +140,7 @@ class ProxyServer { * * @param authentications a map of user/password */ - public AuthAsyncProxyServlet(Map<String, String> authentications) { + AuthAsyncProxyServlet(Map<String, String> authentications) { this(); this.authentications = authentications; @@ -147,7 +152,7 @@ class ProxyServer { * @param authentications a map of user/password * @param sleepTime a positive time to sleep the service thread (for timeout) */ - public AuthAsyncProxyServlet(Map<String, String> authentications, long sleepTime) { + AuthAsyncProxyServlet(Map<String, String> authentications, long sleepTime) { this(); this.authentications = authentications; this.sleepTime = sleepTime;