diff --git a/pom.xml b/pom.xml index 28c60c77..4a86984a 100644 --- a/pom.xml +++ b/pom.xml @@ -69,11 +69,11 @@ under the License. 8 - 3.9.16 + 3.10.0 - 1.9.27 + 2.0.24 - 1.7.36 + 2.0.19 ${version.maven-antrun-plugin} diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java index cd985293..565b13fa 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java @@ -50,6 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.Mockito.when; @@ -191,7 +192,8 @@ void testSkippingDeploy(DeployMojo mojo) throws Exception { mojo.execute(); File[] files = localRepo.listFiles(); - assertNull(files); + // the resolver may create an empty local repository directory + assertTrue(files == null || files.length == 0); files = remoteRepo.listFiles(); assertNull(files); @@ -409,7 +411,9 @@ void testNonPomDeployWithAttachedArtifactsOnly(DeployMojo mojo) throws Exception @InjectMojo(goal = "deploy") void testLegacyAltDeploymentRepositoryWithDefaultLayout(DeployMojo mojo) throws Exception { assertEquals( - new RemoteRepository.Builder("altDeploymentRepository", "default", "http://localhost").build(), + new RemoteRepository.Builder("altDeploymentRepository", "default", "http://localhost") + .setIntent(RemoteRepository.Intent.DEPLOYMENT) + .build(), mojo.getDeploymentRepository( mavenProject, null, null, "altDeploymentRepository::default::http://localhost")); } @@ -450,7 +454,9 @@ void testInsaneAltDeploymentRepository(DeployMojo mojo) { @InjectMojo(goal = "deploy") void testDefaultScmSvnAltDeploymentRepository(DeployMojo mojo) throws Exception { assertEquals( - new RemoteRepository.Builder("altDeploymentRepository", "default", "scm:svn:http://localhost").build(), + new RemoteRepository.Builder("altDeploymentRepository", "default", "scm:svn:http://localhost") + .setIntent(RemoteRepository.Intent.DEPLOYMENT) + .build(), mojo.getDeploymentRepository( mavenProject, null, null, "altDeploymentRepository::default::scm:svn:http://localhost")); } @@ -475,7 +481,9 @@ void testLegacyScmSvnAltDeploymentRepository(DeployMojo mojo) { @InjectMojo(goal = "deploy") void testAltSnapshotDeploymentRepository(DeployMojo mojo) throws Exception { assertEquals( - new RemoteRepository.Builder("altSnapshotDeploymentRepository", "default", "http://localhost").build(), + new RemoteRepository.Builder("altSnapshotDeploymentRepository", "default", "http://localhost") + .setIntent(RemoteRepository.Intent.DEPLOYMENT) + .build(), mojo.getDeploymentRepository( mavenProject, "altSnapshotDeploymentRepository::http://localhost", null, null)); } @@ -486,12 +494,18 @@ void testAltReleaseDeploymentRepository(DeployMojo mojo) throws Exception { mavenProject.setVersion("1.0"); assertEquals( - new RemoteRepository.Builder("altReleaseDeploymentRepository", "default", "http://localhost").build(), + new RemoteRepository.Builder("altReleaseDeploymentRepository", "default", "http://localhost") + .setIntent(RemoteRepository.Intent.DEPLOYMENT) + .build(), mojo.getDeploymentRepository( mavenProject, null, "altReleaseDeploymentRepository::http://localhost", null)); } private void addFileToList(File file, List fileList) { + if (".meta".equals(file.getName()) || ".locks".equals(file.getName())) { + // resolver 2.x bookkeeping directories + return; + } if (!file.isDirectory()) { fileList.add(file.getName()); } else {