Skip to content

Commit

Permalink
[MJAVADOC-795] Upgrade to Parent 42 and Maven 3.6.3
Browse files Browse the repository at this point in the history
This closes #281
  • Loading branch information
michael-o committed May 27, 2024
1 parent b55dd96 commit 4e72048
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 83 deletions.
66 changes: 27 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>41</version>
<version>42</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -111,11 +111,11 @@ under the License.

<properties>
<javaVersion>8</javaVersion>
<mavenVersion>3.2.5</mavenVersion>
<mavenVersion>3.6.3</mavenVersion>
<doxiaVersion>1.11.1</doxiaVersion>
<doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion>
<wagonVersion>2.4</wagonVersion>
<aetherVersion>1.0.0.v20140518</aetherVersion>
<wagonVersion>3.5.3</wagonVersion>
<resolverVersion>1.4.1</resolverVersion>
<!-- https://cwiki.apache.org/confluence/x/VIHOCg#MavenEcosystemCleanup-ResolverandMaven -->
<plexus-java.version>1.2.0</plexus-java.version>
<jetty.version>9.4.53.v20231009</jetty.version>
Expand All @@ -132,36 +132,6 @@ under the License.
<slf4jVersion>1.7.36</slf4jVersion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-wagon</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>${aetherVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>${aetherVersion}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<!-- @TODO remove!! -->
Expand Down Expand Up @@ -206,6 +176,23 @@ under the License.
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>${resolverVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
<version>${resolverVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down Expand Up @@ -386,13 +373,15 @@ under the License.
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-wagon</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -486,7 +475,6 @@ under the License.
<configuration>
<systemPropertyVariables>
<maven.home>${maven.home}</maven.home>
<https.protocols>${https.protocols}</https.protocols>
</systemPropertyVariables>
<environmentVariables>
<JENKINS_MAVEN_AGENT_DISABLED>true</JENKINS_MAVEN_AGENT_DISABLED>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,10 @@ private void executeMojoAndTest(File testPomBasedir, String[] clazzToCompare) th
.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(
session.getRepositorySession(), new LocalRepository(new File("target/local-repo"))));
// Ensure remote repo connection uses SSL
File globalSettingsFile = new File(getBasedir(), "target/test-classes/unit/settings.xml");
session.getRequest().setGlobalSettingsFile(globalSettingsFile);
setVariableValueToObject(mojo, "session", session);

// compile the test project
invokeCompileGoal(testPom, globalSettingsFile, mojo.getLog());
invokeCompileGoal(testPom, mojo.getLog());
assertTrue(new File(testPomBasedir, "target/classes").exists());

mojo.execute();
Expand All @@ -532,7 +529,7 @@ private void executeMojoAndTest(File testPomBasedir, String[] clazzToCompare) th
* @param log not null
* @throws MavenInvocationException if any
*/
private void invokeCompileGoal(File testPom, File globalSettingsFile, Log log) throws Exception {
private void invokeCompileGoal(File testPom, Log log) throws Exception {
List<String> goals = new ArrayList<>();
goals.add("clean");
goals.add("compile");
Expand All @@ -543,13 +540,7 @@ private void invokeCompileGoal(File testPom, File globalSettingsFile, Log log) t
Properties properties = new Properties();

JavadocUtil.invokeMaven(
log,
new File(getBasedir(), "target/local-repo"),
testPom,
goals,
properties,
invokerLogFile,
globalSettingsFile);
log, new File(getBasedir(), "target/local-repo"), testPom, goals, properties, invokerLogFile, null);
}

// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.apache.maven.plugins.javadoc.ProxyServer.AuthAsyncProxyServlet;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.project.ProjectBuildingRequest.RepositoryMerging;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import org.apache.maven.shared.utils.io.FileUtils;
Expand Down Expand Up @@ -905,6 +906,7 @@ public void testProxy() throws Exception {
MavenSession session = spy(newMavenSession(mojo.project));
ProjectBuildingRequest buildingRequest = mock(ProjectBuildingRequest.class);
when(buildingRequest.getRemoteRepositories()).thenReturn(mojo.project.getRemoteArtifactRepositories());
when(buildingRequest.getRepositoryMerging()).thenReturn(RepositoryMerging.POM_DOMINANT);
when(session.getProjectBuildingRequest()).thenReturn(buildingRequest);
DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
repositorySession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
Expand Down Expand Up @@ -1097,8 +1099,6 @@ public void testTagletArtifacts() throws Exception {
repoSysSession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(session.getRepositorySession(), new LocalRepository(new File("target/local-repo"))));
// Ensure remote repo connection uses SSL
File globalSettingsFile = new File(getBasedir(), "target/test-classes/unit/settings.xml");
session.getRequest().setGlobalSettingsFile(globalSettingsFile);
LegacySupport legacySupport = lookup(LegacySupport.class);
legacySupport.setSession(session);
setVariableValueToObject(mojo, "session", session);
Expand Down
30 changes: 0 additions & 30 deletions src/test/resources/unit/settings.xml

This file was deleted.

0 comments on commit 4e72048

Please sign in to comment.