Skip to content

Commit a570552

Browse files
committed
[MNG-8301] Can't build a project without modelVersion=4.1.0 but with 4.1.0 (beta-4) XSD
1 parent 57dee65 commit a570552

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.maven.it;
20+
21+
import java.io.File;
22+
23+
import org.apache.maven.shared.verifier.Verifier;
24+
import org.apache.maven.shared.verifier.util.ResourceExtractor;
25+
import org.junit.jupiter.api.Test;
26+
27+
/**
28+
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8301">MNG-8301</a>.
29+
*/
30+
class MavenITmng8301ProjectWithoutModelVersion extends AbstractMavenIntegrationTestCase {
31+
MavenITmng8301ProjectWithoutModelVersion() {
32+
super("[4.0.0-beta-5,)");
33+
}
34+
35+
@Test
36+
void projectWithoutModelVersionCanBeBuilt() throws Exception {
37+
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8301-project-without-modelversion");
38+
39+
Verifier verifier = new Verifier(testDir.getAbsolutePath());
40+
verifier.executeGoal("validate");
41+
42+
verifier.verifyErrorFreeLog();
43+
}
44+
}

core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public TestSuiteOrdering() {
120120
* the tests are to finishing. Newer tests are also more likely to fail, so this is
121121
* a fail fast technique as well.
122122
*/
123+
suite.addTestSuite(MavenITmng8301ProjectWithoutModelVersion.class, -9);
123124
suite.addTestSuite(MavenITmng8294ParentChecksTest.class);
124125
suite.addTestSuite(MavenITmng8293BomImportFromReactor.class);
125126
suite.addTestSuite(MavenITmng8288NoRootPomTest.class);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">
3+
4+
<parent>
5+
<groupId>org.apache.maven.its.mng8301</groupId>
6+
<artifactId>m4womv</artifactId>
7+
</parent>
8+
9+
<artifactId>module-a</artifactId>
10+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">
3+
4+
<parent>
5+
<groupId>org.apache.maven.its.mng8301</groupId>
6+
<artifactId>m4womv</artifactId>
7+
</parent>
8+
9+
<artifactId>module-b</artifactId>
10+
11+
<dependencies>
12+
<dependency>
13+
<groupId>org.apache.maven.repro</groupId>
14+
<artifactId>module-a</artifactId>
15+
</dependency>
16+
</dependencies>
17+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">
3+
4+
<groupId>org.apache.maven.its.mng8301</groupId>
5+
<artifactId>m4womv</artifactId>
6+
<!-- Maven 4 without modelVersion -->
7+
<version>1-SNAPSHOT</version>
8+
<packaging>pom</packaging>
9+
10+
<modules>
11+
<module>module-a</module>
12+
<module>module-b</module>
13+
</modules>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.release>17</maven.compiler.release>
18+
</properties>
19+
20+
<build>
21+
<pluginManagement>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.13.0</version>
27+
</plugin>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-jar-plugin</artifactId>
31+
<version>3.4.2</version>
32+
</plugin>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-resources-plugin</artifactId>
36+
<version>3.3.1</version>
37+
</plugin>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-surefire-plugin</artifactId>
41+
<version>3.5.0</version>
42+
</plugin>
43+
</plugins>
44+
</pluginManagement>
45+
</build>
46+
</project>

0 commit comments

Comments
 (0)