From 1d6485593ca4b17c1fbfc2bb6d916843003563c6 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sun, 7 Jan 2024 15:24:38 +0100 Subject: [PATCH] Fix next ITs for Maven 4 --- .gitignore | 3 ++- .../mrm/{ => repository}/parent-deps-1.1.pom | 0 .../invoker.properties | 2 +- .../.flattened-pom.xml | 15 ++++++++++++ .../invoker.properties | 2 ++ .../projects/no-overwrite-4.0.0-later/pom.xml | 20 ++++++++++++++++ .../no-overwrite-4.0.0-later/verify.groovy | 23 +++++++++++++++++++ 7 files changed, 63 insertions(+), 2 deletions(-) rename src/it/mrm/{ => repository}/parent-deps-1.1.pom (100%) create mode 100644 src/it/projects/no-overwrite-4.0.0-later/.flattened-pom.xml create mode 100644 src/it/projects/no-overwrite-4.0.0-later/invoker.properties create mode 100644 src/it/projects/no-overwrite-4.0.0-later/pom.xml create mode 100644 src/it/projects/no-overwrite-4.0.0-later/verify.groovy diff --git a/.gitignore b/.gitignore index d7accdfe..54d605cc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ out .project .settings .idea -*.iml \ No newline at end of file +*.iml +.DS_Store diff --git a/src/it/mrm/parent-deps-1.1.pom b/src/it/mrm/repository/parent-deps-1.1.pom similarity index 100% rename from src/it/mrm/parent-deps-1.1.pom rename to src/it/mrm/repository/parent-deps-1.1.pom diff --git a/src/it/projects/no-overwrite-3.6.3-later/invoker.properties b/src/it/projects/no-overwrite-3.6.3-later/invoker.properties index e39bdef2..14b08be9 100644 --- a/src/it/projects/no-overwrite-3.6.3-later/invoker.properties +++ b/src/it/projects/no-overwrite-3.6.3-later/invoker.properties @@ -1,3 +1,3 @@ # .flattened-pom.xml contains xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" # xsd url changed to HTTPS in Maven 3.6.3 in https://issues.apache.org/jira/browse/MNG-6778 -invoker.maven.version = 3.6.3+ +invoker.maven.version = 3.6.3+,!4.0.0+ diff --git a/src/it/projects/no-overwrite-4.0.0-later/.flattened-pom.xml b/src/it/projects/no-overwrite-4.0.0-later/.flattened-pom.xml new file mode 100644 index 00000000..460865d9 --- /dev/null +++ b/src/it/projects/no-overwrite-4.0.0-later/.flattened-pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + org.codehaus.mojo.flatten.its + resolve-properties + 0.0.1-SNAPSHOT + + + org.codehaus.mojo.flatten.its + dep + 1.1 + compile + + + \ No newline at end of file diff --git a/src/it/projects/no-overwrite-4.0.0-later/invoker.properties b/src/it/projects/no-overwrite-4.0.0-later/invoker.properties new file mode 100644 index 00000000..c0122084 --- /dev/null +++ b/src/it/projects/no-overwrite-4.0.0-later/invoker.properties @@ -0,0 +1,2 @@ +# Maven 4.0.0 has a different xml writer +invoker.maven.version = 4.0.0+ diff --git a/src/it/projects/no-overwrite-4.0.0-later/pom.xml b/src/it/projects/no-overwrite-4.0.0-later/pom.xml new file mode 100644 index 00000000..24074863 --- /dev/null +++ b/src/it/projects/no-overwrite-4.0.0-later/pom.xml @@ -0,0 +1,20 @@ + + 4.0.0 + org.codehaus.mojo.flatten.its + resolve-properties + 0.0.1-SNAPSHOT + + + 1.1 + + + + + org.codehaus.mojo.flatten.its + dep + ${depVersion} + + + + diff --git a/src/it/projects/no-overwrite-4.0.0-later/verify.groovy b/src/it/projects/no-overwrite-4.0.0-later/verify.groovy new file mode 100644 index 00000000..8096d0b9 --- /dev/null +++ b/src/it/projects/no-overwrite-4.0.0-later/verify.groovy @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +File flattendPom = new File( basedir, '.flattened-pom.xml' ) +assert flattendPom.exists() +long now = System.currentTimeMillis() +assert now - flattendPom.lastModified() > 20*1000