File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/test/java/org/apache/maven/plugins/dependency/fromConfiguration Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1919 * under the License.
2020 */
2121
22+ import static org .junit .Assume .assumeTrue ;
23+
2224import java .io .File ;
2325import java .io .IOException ;
2426import java .nio .file .Files ;
@@ -155,6 +157,23 @@ public void assertFileExists( ArtifactItem item, boolean exist )
155157 assertEquals ( exist , file .exists () );
156158 }
157159
160+ private static final boolean supportsSymbolicLinks = supportsSymbolicLinks ();
161+
162+ private static boolean supportsSymbolicLinks ( )
163+ {
164+ try {
165+ Path target = Files .createTempFile (null , null );
166+ Path link = Files .createTempFile (null , null );
167+ Files .delete (link );
168+ Files .createSymbolicLink (target , link );
169+ Files .delete (link );
170+ Files .delete (target );
171+ return true ;
172+ } catch ( Exception e ) {
173+ return false ;
174+ }
175+ }
176+
158177 public void assertFilesAreLinks ( Collection <ArtifactItem > items , boolean areLinks )
159178 {
160179 for ( ArtifactItem item : items )
@@ -268,6 +287,8 @@ public void testCopyToLocation()
268287 public void testLink ()
269288 throws Exception
270289 {
290+ assumeTrue ("supports symbolic links" , supportsSymbolicLinks );
291+
271292 List <ArtifactItem > list = stubFactory .getArtifactItems ( stubFactory .getClassifiedArtifacts () );
272293
273294 mojo .setArtifactItems ( createArtifactItemArtifacts ( list ) );
You can’t perform that action at this time.
0 commit comments