Closed
Description
Hi,
I was wondering why maven-shade-plugin produces different results on Windows and MAC. The single wildcard match is working inconsistently depending on the OS.
Please find a test to reproduce this (see comments in test file):
import org.codehaus.plexus.util.SelectorUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class PatternMatcherTest {
@Test
void testPatternMatchSingleWildCardLinux() {
/* Passes on Linux - fails on Windows */
Assertions.assertFalse(SelectorUtils.matchPath(
"/com/test/*",
"/com/test/test/hallo"));
}
@Test
void testPatternMatchDoubleWildCardCaseInLinux() {
/* OK */
Assertions.assertTrue(SelectorUtils.matchPath(
"/com/test/**",
"/com/test/test/hallo"));
}
@Test
void testPatternMatchDoubleWildCardLinux() {
/* OK */
Assertions.assertTrue(SelectorUtils.matchPath(
"/com/test/**",
"/com/test/test/hallo"));
}
@Test
void testPatternMatchSingleWildCardWindows() {
/* Fails on Linux - passes on Windows */
Assertions.assertFalse(SelectorUtils.matchPath(
"D:\\com\\test\\*",
"D:\\com\\test\\test\\hallo"));
}
@Test
void testPatternMatchDoubleWildCardWindows() {
/* OK */
Assertions.assertTrue(SelectorUtils.matchPath(
"D:\\com\\test\\**",
"D:\\com\\test\\test\\hallo"));
}
@Test
void testPatternMatchSingleWildCardDotLinux() {
/* Fails on Linux - fails on Windows */
Assertions.assertFalse(SelectorUtils.matchPath(
"com.test.*",
"com.test.test.hallo"));
}
@Test
void testPatternMatchDoubleWildCardDotLinux() {
/* OK */
Assertions.assertTrue(SelectorUtils.matchPath(
"com.test.**",
"com.test.test.hallo"));
}
}
BG
Metadata
Metadata
Assignees
Labels
No labels