Normalize regex patterns

This #990
This commit is contained in:
Andrey Bruykhov 2023-02-08 20:34:39 +03:00 committed by Michael Osipov
parent 6e25a2674b
commit 7b38457506
4 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ public interface Artifact extends Comparable<Artifact> {
String SNAPSHOT_VERSION = "SNAPSHOT";
Pattern VERSION_FILE_PATTERN = Pattern.compile("^(.*)-([0-9]{8}\\.[0-9]{6})-([0-9]+)$");
Pattern VERSION_FILE_PATTERN = Pattern.compile("^(.*)-(\\d{8}\\.\\d{6})-(\\d+)$");
// TODO into artifactScope handler

View File

@ -179,7 +179,7 @@ public class ProjectBuilderTest extends AbstractCoreMavenComponentTestCase {
// modify parent
File parent = new File(tempDir.toFile(), "pom.xml");
String parentContent = FileUtils.readFileToString(parent, "UTF-8");
parentContent = parentContent.replaceAll(
parentContent = parentContent.replace(
"<packaging>pom</packaging>",
"<packaging>pom</packaging><properties><addedProperty>addedValue</addedProperty></properties>");
FileUtils.write(parent, parentContent, "UTF-8");

View File

@ -44,7 +44,7 @@ import org.apache.maven.model.profile.ProfileActivationContext;
@Singleton
public class JdkVersionProfileActivator implements ProfileActivator {
private static final Pattern FILTER_1 = Pattern.compile("[^0-9._-]");
private static final Pattern FILTER_1 = Pattern.compile("[^\\d._-]");
private static final Pattern FILTER_2 = Pattern.compile("[._-]");
private static final Pattern FILTER_3 = Pattern.compile("\\."); // used for split now

View File

@ -68,7 +68,7 @@ import org.codehaus.plexus.util.StringUtils;
@Singleton
public class DefaultModelValidator implements ModelValidator {
private static final Pattern EXPRESSION_NAME_PATTERN = Pattern.compile("\\$\\{(.+?)\\}");
private static final Pattern EXPRESSION_NAME_PATTERN = Pattern.compile("\\$\\{(.+?)}");
private static final String ILLEGAL_FS_CHARS = "\\/:\"<>|?*";