From 45cd37f5ef610f5f39c73d153c4ed481798e8ee8 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Sun, 4 Mar 2018 20:17:31 +0100 Subject: [PATCH] More Path replacements --- .../release/phase/CheckoutProjectFromScm.java | 18 +++++-------- .../shared/release/util/ReleaseUtil.java | 6 ----- .../release/DefaultReleaseManagerTest.java | 3 +-- .../PropertiesReleaseDescriptorStoreTest.java | 13 +++++---- .../release/config/ReleaseUtilsTest.java | 5 ++-- .../phase/AbstractReleaseTestCase.java | 7 ----- .../release/phase/ScmBranchPhaseTest.java | 27 +++++++------------ .../shared/release/phase/ScmTagPhaseTest.java | 27 +++++++------------ 8 files changed, 36 insertions(+), 70 deletions(-) diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java index 60f78b8c9..cbed6ea65 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Path; import java.util.List; import org.apache.maven.project.MavenProject; @@ -221,10 +222,10 @@ private ReleaseResult performCheckout( ReleaseDescriptor releaseDescriptor, Rele String scmRelativePathProjectDirectory = scmResult.getRelativePathProjectDirectory(); if ( StringUtils.isEmpty( scmRelativePathProjectDirectory ) ) { - String basedir; + Path basedir; try { - basedir = ReleaseUtil.getCommonBasedir( reactorProjects ).toString(); + basedir = ReleaseUtil.getCommonBasedir( reactorProjects ); } catch ( IOException e ) { @@ -232,22 +233,17 @@ private ReleaseResult performCheckout( ReleaseDescriptor releaseDescriptor, Rele + e.getMessage(), e ); } - String rootProjectBasedir = rootProject.getBasedir().getAbsolutePath(); + Path rootProjectBasedir; try { - if ( ReleaseUtil.isSymlink( rootProject.getBasedir() ) ) - { - rootProjectBasedir = rootProject.getBasedir().getCanonicalPath(); - } + rootProjectBasedir = rootProject.getBasedir().toPath().toRealPath(); } catch ( IOException e ) { throw new ReleaseExecutionException( e.getMessage(), e ); } - if ( rootProjectBasedir.length() > basedir.length() ) - { - scmRelativePathProjectDirectory = rootProjectBasedir.substring( basedir.length() + 1 ); - } + + scmRelativePathProjectDirectory = basedir.relativize( rootProjectBasedir ).toString(); } releaseDescriptor.setScmRelativePathProjectDirectory( scmRelativePathProjectDirectory ); diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java index 587a50c30..2afd54526 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java @@ -243,12 +243,6 @@ public static String realignScmUrl( int parentLevels, String url ) return url; } - public static boolean isSymlink( File file ) - throws IOException - { - return !file.getAbsolutePath().equals( file.getCanonicalPath() ); - } - public static String interpolate( String value, Model model ) throws ReleaseExecutionException { diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java index 142d49beb..11e7f83d2 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java @@ -690,9 +690,8 @@ public void testScmResultFailure() fail( "commit should have failed" ); } - catch ( ReleaseScmCommandException e ) + catch ( ReleaseExecutionException e ) { - assertNull( "check no other cause", e.getCause() ); } } diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java index 35903ce01..394330e61 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java @@ -21,7 +21,6 @@ * under the License. */ -import org.apache.maven.shared.release.phase.AbstractReleaseTestCase; import org.apache.maven.shared.release.scm.IdentifiedScm; import org.codehaus.plexus.PlexusTestCase; import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; @@ -66,7 +65,7 @@ public void testReadFromFileUsingWorkingDirectory() throws Exception { ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); - builder.setWorkingDirectory( AbstractReleaseTestCase.getPath( getTestFile( "target/test-classes" ) ) ); + builder.setWorkingDirectory( getTestFile( "target/test-classes" ).getAbsolutePath() ); ReleaseDescriptor config = store.read( builder ).build(); ReleaseDescriptorBuilder expected = createExpectedReleaseConfiguration(); @@ -145,12 +144,12 @@ public void testWriteToWorkingDirectory() file.getParentFile().mkdirs(); ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting(); - config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile() ) ); + config.setWorkingDirectory( file.getParentFile().getAbsolutePath() ); store.write( config.build() ); ReleaseDescriptorBuilder rereadDescriptorBuilder = store.read( file ); - rereadDescriptorBuilder.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile() ) ); + rereadDescriptorBuilder.setWorkingDirectory( file.getParentFile().getAbsolutePath() ); assertAndAdjustScmPassword( config, rereadDescriptorBuilder.build() ); assertAndAdjustScmPrivateKeyPassPhrase( config, rereadDescriptorBuilder.build() ); @@ -258,7 +257,7 @@ public void testDeleteFile() assertTrue( "Check file already exists", file.exists() ); ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting(); - config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile() ) ); + config.setWorkingDirectory( file.getParentFile().getAbsolutePath() ); store.delete( config.build() ); @@ -274,7 +273,7 @@ public void testMissingDeleteFile() assertFalse( "Check file already exists", file.exists() ); ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting(); - config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile() ) ); + config.setWorkingDirectory( file.getParentFile().getAbsolutePath() ); store.delete( config.build() ); @@ -359,7 +358,7 @@ public ReleaseDescriptorBuilder createMergeConfiguration() releaseDescriptor.setScmSourceUrl( "scm-url" ); releaseDescriptor.setScmUsername( "username" ); // Not setting other optional SCM settings for brevity - releaseDescriptor.setWorkingDirectory( AbstractReleaseTestCase.getPath( getTestFile( "target/test-working-directory" ) ) ); + releaseDescriptor.setWorkingDirectory( getTestFile( "target/test-working-directory" ).getAbsolutePath() ); // Not setting non-override setting completedPhase return releaseDescriptor; diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java index 4cff313cb..a8212da74 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java @@ -24,7 +24,6 @@ import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.model.Scm; import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder.BuilderReleaseDescriptor; -import org.apache.maven.shared.release.phase.AbstractReleaseTestCase; import java.io.File; import java.io.IOException; @@ -134,7 +133,7 @@ private static void doEqualsAssertions( ReleaseDescriptorBuilder releaseDescript if ( otherFile != null ) { - configBuilder.setWorkingDirectory( AbstractReleaseTestCase.getPath( otherFile ) ); + configBuilder.setWorkingDirectory( otherFile.getAbsolutePath() ); assertFalse( "Check original comparison", configBuilder.build().equals( origConfig ) ); } @@ -265,7 +264,7 @@ private static ReleaseDescriptorBuilder createReleaseDescriptor() { File workingDirectory = new File( "." ); - return createReleaseDescriptor(AbstractReleaseTestCase.getPath( workingDirectory ) ); + return createReleaseDescriptor( workingDirectory.getAbsolutePath() ); } private static ReleaseDescriptorBuilder createReleaseDescriptor( String workingDirectory ) diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java index 96eadcd17..ed9cfd176 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java @@ -58,7 +58,6 @@ import org.apache.maven.repository.internal.MavenRepositorySystemSession; import org.apache.maven.shared.release.PlexusJUnit4TestCase; import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder; -import org.apache.maven.shared.release.util.ReleaseUtil; import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; import org.sonatype.aether.repository.WorkspaceReader; import org.sonatype.aether.repository.WorkspaceRepository; @@ -336,12 +335,6 @@ private String getRemoteRepositoryURL() return "file://" + getTestFile( "src/test/remote-repository" ).getCanonicalPath().replace( '\\', '/' ); } - public static String getPath( File file ) - throws IOException - { - return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath(); - } - /** * WorkspaceReader to find versions and artifacts from reactor */ diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java index 9136cb299..505b9633b 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java @@ -31,7 +31,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -78,12 +77,6 @@ public void setUp() phase = lookup( ReleasePhase.class, "scm-branch" ); } - public static String getPath( File file ) - throws IOException - { - return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath(); - } - @Test public void testBranch() throws Exception @@ -93,7 +86,7 @@ public void testBranch() List reactorProjects = createReactorProjects(); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -103,7 +96,7 @@ public void testBranch() when( scmProviderMock.branch( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); stub.setScmProvider( scmProviderMock ); @@ -131,7 +124,7 @@ public void testCommitMultiModuleDeepFolders() ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( scmUrl ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); builder.setScmBranchBase( "http://svn.example.com/repos/project/branches/" ); @@ -145,7 +138,7 @@ public void testCommitMultiModuleDeepFolders() when( scmProviderMock.branch( eq( repository ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -172,7 +165,7 @@ public void testCommitForFlatMultiModule() MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( rootProject.getScm().getConnection() ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -186,7 +179,7 @@ public void testCommitForFlatMultiModule() when( scmProviderMock.branch( eq( repository ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -213,7 +206,7 @@ public void testCommitMultiModule() List reactorProjects = createReactorProjects( dir, dir, null ); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -223,7 +216,7 @@ public void testCommitMultiModule() when( scmProviderMock.branch( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -265,7 +258,7 @@ public void testSimulateBranch() List reactorProjects = createReactorProjects(); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); ScmProvider scmProviderMock = mock( ScmProvider.class ); @@ -421,7 +414,7 @@ private static ReleaseDescriptorBuilder createReleaseDescriptorBuilder() ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( "scm-url" ); builder.setScmReleaseLabel( "release-label" ); - builder.setWorkingDirectory( getPath( getTestFile( "target/test/checkout" ) ) ); + builder.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath() ); return builder; } } diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java index 1ac428b45..c9ab7533c 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java @@ -31,7 +31,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -78,12 +77,6 @@ public void setUp() phase = (ReleasePhase) lookup( ReleasePhase.class, "scm-tag" ); } - public static String getPath( File file ) - throws IOException - { - return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath(); - } - @Test public void testTag() throws Exception @@ -93,7 +86,7 @@ public void testTag() List reactorProjects = createReactorProjects(); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -103,7 +96,7 @@ public void testTag() when( scmProviderMock.tag( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmTagParametersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); stub.setScmProvider( scmProviderMock ); @@ -130,7 +123,7 @@ public void testCommitMultiModuleDeepFolders() ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( scmUrl ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); builder.setScmTagBase( "http://svn.example.com/repos/project/releases/" ); @@ -144,7 +137,7 @@ public void testCommitMultiModuleDeepFolders() when( scmProviderMock.tag( eq( repository ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmTagParametersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -171,7 +164,7 @@ public void testCommitForFlatMultiModule() MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( rootProject.getScm().getConnection() ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -185,7 +178,7 @@ public void testCommitForFlatMultiModule() when( scmProviderMock.tag( eq( repository ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmTagParametersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -212,7 +205,7 @@ public void testCommitMultiModule() List reactorProjects = createReactorProjects( dir, dir, null ); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); builder.setScmCommentPrefix( "[my prefix] " ); @@ -222,7 +215,7 @@ public void testCommitMultiModule() when( scmProviderMock.tag( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals( fileSet ) ), eq( "release-label" ), argThat( new IsScmTagParametersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...", - Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ), + Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(), ScmFileStatus.TAGGED ) ) ) ); ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class ); @@ -264,7 +257,7 @@ public void testSimulateTag() List reactorProjects = createReactorProjects(); builder.setScmSourceUrl( "scm-url" ); MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); - builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) ); + builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath() ); builder.setScmReleaseLabel( "release-label" ); ScmProvider scmProviderMock = mock( ScmProvider.class ); @@ -418,7 +411,7 @@ private static ReleaseDescriptorBuilder createReleaseDescriptorBuilder() ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.setScmSourceUrl( "scm-url" ); builder.setScmReleaseLabel( "release-label" ); - builder.setWorkingDirectory( getPath( getTestFile( "target/test/checkout" ) ) ); + builder.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath() ); return builder; } }