Skip to content

Commit

Permalink
Fix next ITs for Maven 4
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jan 9, 2024
1 parent adcac60 commit 9aa051f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ out
.project
.settings
.idea
*.iml
*.iml
.DS_Store
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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+
15 changes: 15 additions & 0 deletions src/it/projects/no-overwrite-4.0.0-later/.flattened-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>resolve-properties</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
2 changes: 2 additions & 0 deletions src/it/projects/no-overwrite-4.0.0-later/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Maven 4.0.0 has a different xml writer
invoker.maven.version = 4.0.0+
20 changes: 20 additions & 0 deletions src/it/projects/no-overwrite-4.0.0-later/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>resolve-properties</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<depVersion>1.1</depVersion>
</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>${depVersion}</version>
</dependency>
</dependencies>

</project>
23 changes: 23 additions & 0 deletions src/it/projects/no-overwrite-4.0.0-later/verify.groovy
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9aa051f

Please sign in to comment.