Skip to content

Commit

Permalink
[MNG-8301] Can't build a project without modelVersion=4.1.0 but with …
Browse files Browse the repository at this point in the history
…4.1.0 (beta-4) XSD
  • Loading branch information
mthmulders committed Oct 12, 2024
1 parent 57dee65 commit a570552
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.
*/
package org.apache.maven.it;

import java.io.File;

import org.apache.maven.shared.verifier.Verifier;
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test;

/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8301">MNG-8301</a>.
*/
class MavenITmng8301ProjectWithoutModelVersion extends AbstractMavenIntegrationTestCase {
MavenITmng8301ProjectWithoutModelVersion() {
super("[4.0.0-beta-5,)");
}

@Test
void projectWithoutModelVersionCanBeBuilt() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8301-project-without-modelversion");

Verifier verifier = new Verifier(testDir.getAbsolutePath());
verifier.executeGoal("validate");

verifier.verifyErrorFreeLog();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public TestSuiteOrdering() {
* the tests are to finishing. Newer tests are also more likely to fail, so this is
* a fail fast technique as well.
*/
suite.addTestSuite(MavenITmng8301ProjectWithoutModelVersion.class, -9);
suite.addTestSuite(MavenITmng8294ParentChecksTest.class);
suite.addTestSuite(MavenITmng8293BomImportFromReactor.class);
suite.addTestSuite(MavenITmng8288NoRootPomTest.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">

<parent>
<groupId>org.apache.maven.its.mng8301</groupId>
<artifactId>m4womv</artifactId>
</parent>

<artifactId>module-a</artifactId>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">

<parent>
<groupId>org.apache.maven.its.mng8301</groupId>
<artifactId>m4womv</artifactId>
</parent>

<artifactId>module-b</artifactId>

<dependencies>
<dependency>
<groupId>org.apache.maven.repro</groupId>
<artifactId>module-a</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?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.1.0 https://maven.apache.org/xsd/maven-4.1.0-beta-4.xsd">

<groupId>org.apache.maven.its.mng8301</groupId>
<artifactId>m4womv</artifactId>
<!-- Maven 4 without modelVersion -->
<version>1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>module-a</module>
<module>module-b</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

0 comments on commit a570552

Please sign in to comment.