Skip to content

Commit 96c6509

Browse files
committed
Fix ITs for BOM packaging / build pom
1 parent eaaf6d5 commit 96c6509

17 files changed

+253
-161
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void testitMNG1021() throws Exception {
4848
verifier.setAutoclean(false);
4949
verifier.deleteDirectory("repo");
5050
verifier.deleteArtifacts("org.apache.maven.its.mng1021");
51+
verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false");
5152
verifier.addCliArgument("initialize");
5253
verifier.execute();
5354
verifier.verifyErrorFreeLog();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void testitMNG3396() throws Exception {
4646
verifier.deleteArtifact(GROUP_ID, "A", "1.0", "jar");
4747
verifier.deleteArtifact(GROUP_ID, "B", "1.0", "pom");
4848
verifier.deleteArtifact(GROUP_ID, "B", "1.0", "jar");
49+
verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false");
4950
verifier.addCliArgument("install");
5051
verifier.execute();
5152
verifier.verifyErrorFreeLog();
@@ -59,6 +60,7 @@ public void testitMNG3396() throws Exception {
5960
verifier.deleteArtifact(GROUP_ID, "A", "3.0", "jar");
6061
verifier.deleteArtifact(GROUP_ID, "plugin", "1.0", "pom");
6162
verifier.deleteArtifact(GROUP_ID, "plugin", "1.0", "jar");
63+
verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false");
6264
verifier.addCliArgument("install");
6365
verifier.execute();
6466
verifier.verifyErrorFreeLog();
@@ -68,6 +70,7 @@ public void testitMNG3396() throws Exception {
6870
verifier = newVerifier(testDir.getAbsolutePath(), "remote");
6971
verifier.deleteArtifact(GROUP_ID, "pluginuser", "1.0", "pom");
7072
verifier.deleteArtifact(GROUP_ID, "pluginuser", "1.0", "jar");
73+
verifier.addCliArgument("-Dmaven.experimental.buildconsumer=false");
7174
verifier.addCliArgument("install");
7275
verifier.execute();
7376
verifier.verifyErrorFreeLog();

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,23 @@ public void testPublishedPoms() throws Exception {
8787
new File(verifier.getArtifactPath(
8888
"org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom")));
8989

90+
assertTextEquals(
91+
new File(testDir, "expected/simple-weather-build.pom"),
92+
new File(verifier.getArtifactPath(
93+
"org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6656-SNAPSHOT", "pom", "build")));
94+
9095
assertTextEquals(
9196
new File(testDir, "expected/simple-webapp.pom"),
9297
new File(verifier.getArtifactPath(
9398
"org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6656-SNAPSHOT", "pom")));
99+
100+
assertTextEquals(
101+
new File(testDir, "expected/simple-webapp-build.pom"),
102+
new File(verifier.getArtifactPath(
103+
"org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6656-SNAPSHOT", "pom", "build")));
94104
}
95105

96106
static void assertTextEquals(File file1, File file2) throws IOException {
97-
assertEquals(FileUtils.loadFile(file1), FileUtils.loadFile(file2));
107+
assertEquals(FileUtils.fileRead(file1), FileUtils.fileRead(file2));
98108
}
99109
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,31 @@ public void testPublishedPoms() throws Exception {
8787
new File(verifier.getArtifactPath(
8888
"org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom")));
8989

90+
assertTextEquals(
91+
new File(testDir, "expected/simple-weather-build.pom"),
92+
new File(verifier.getArtifactPath(
93+
"org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom", "build")));
94+
9095
assertTextEquals(
9196
new File(testDir, "expected/simple-webapp.pom"),
9297
new File(verifier.getArtifactPath(
9398
"org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom")));
9499

100+
assertTextEquals(
101+
new File(testDir, "expected/simple-webapp-build.pom"),
102+
new File(verifier.getArtifactPath(
103+
"org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom", "build")));
104+
95105
assertTextEquals(
96106
new File(testDir, "expected/simple-testutils.pom"),
97107
new File(verifier.getArtifactPath(
98108
"org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom")));
99109

110+
assertTextEquals(
111+
new File(testDir, "expected/simple-testutils-build.pom"),
112+
new File(verifier.getArtifactPath(
113+
"org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom", "build")));
114+
100115
assertTextEquals(
101116
new File(testDir, "expected/utils-parent.pom"),
102117
new File(verifier.getArtifactPath(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void testLeakyModel() throws Exception {
5454

5555
verifier.verifyErrorFreeLog();
5656

57-
String pom = FileUtils.readFileToString(
58-
new File(verifier.getArtifactPath("org.apache.maven.its.mng7228", "test", "1.0.0-SNAPSHOT", "pom")));
57+
String pom = FileUtils.readFileToString(new File(
58+
verifier.getArtifactPath("org.apache.maven.its.mng7228", "test", "1.0.0-SNAPSHOT", "pom", "build")));
5959

6060
assertThat(pom, containsString("projectProperty"));
6161
assertThat(pom, not(containsString("activeProperty")));

core-it-suite/src/test/resources/mng-6656-buildconsumer/expected/simple-parent.pom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ under the License.
2727
<artifactId>simple-parent</artifactId>
2828
<packaging>pom</packaging>
2929
<name>Multi Chapter Simple Parent Project</name>
30-
30+
3131

3232

3333
<build>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
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 https://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.sonatype.mavenbook.multi</groupId>
24+
<artifactId>simple-parent</artifactId>
25+
<version>0.9-MNG6656-SNAPSHOT</version>
26+
</parent>
27+
<artifactId>simple-weather</artifactId>
28+
<packaging>jar</packaging>
29+
30+
<name>Multi Chapter Simple Weather API</name>
31+
32+
</project>
Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
19-
-->
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 https://maven.apache.org/maven-v4_0_0.xsd">
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.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
213
<modelVersion>4.0.0</modelVersion>
22-
<parent>
23-
<groupId>org.sonatype.mavenbook.multi</groupId>
24-
<artifactId>simple-parent</artifactId>
25-
<version>0.9-MNG6656-SNAPSHOT</version>
26-
</parent>
4+
<groupId>org.sonatype.mavenbook.multi</groupId>
275
<artifactId>simple-weather</artifactId>
28-
<packaging>jar</packaging>
29-
6+
<version>0.9-MNG6656-SNAPSHOT</version>
307
<name>Multi Chapter Simple Weather API</name>
31-
32-
</project>
8+
</project>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
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 https://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.sonatype.mavenbook.multi</groupId>
24+
<artifactId>simple-parent</artifactId>
25+
<version>0.9-MNG6656-SNAPSHOT</version>
26+
</parent>
27+
28+
<artifactId>simple-webapp</artifactId>
29+
<name>Multi Chapter Simple Web Application Project</name>
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.sonatype.mavenbook.multi</groupId>
33+
<artifactId>simple-weather</artifactId>
34+
<version>0.9-MNG6656-SNAPSHOT</version>
35+
</dependency>
36+
</dependencies>
37+
<build>
38+
<finalName>simple-webapp</finalName>
39+
<pluginManagement>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-war-plugin</artifactId>
44+
<version>3.3.2</version>
45+
</plugin>
46+
</plugins>
47+
</pluginManagement>
48+
</build>
49+
</project>
Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
19-
-->
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 https://maven.apache.org/maven-v4_0_0.xsd">
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.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
213
<modelVersion>4.0.0</modelVersion>
22-
<parent>
23-
<groupId>org.sonatype.mavenbook.multi</groupId>
24-
<artifactId>simple-parent</artifactId>
25-
<version>0.9-MNG6656-SNAPSHOT</version>
26-
</parent>
27-
4+
<groupId>org.sonatype.mavenbook.multi</groupId>
285
<artifactId>simple-webapp</artifactId>
6+
<version>0.9-MNG6656-SNAPSHOT</version>
297
<name>Multi Chapter Simple Web Application Project</name>
308
<dependencies>
319
<dependency>
3210
<groupId>org.sonatype.mavenbook.multi</groupId>
3311
<artifactId>simple-weather</artifactId>
3412
<version>0.9-MNG6656-SNAPSHOT</version>
13+
<scope>compile</scope>
3514
</dependency>
3615
</dependencies>
37-
<build>
38-
<finalName>simple-webapp</finalName>
39-
<pluginManagement>
40-
<plugins>
41-
<plugin>
42-
<groupId>org.apache.maven.plugins</groupId>
43-
<artifactId>maven-war-plugin</artifactId>
44-
<version>3.3.2</version>
45-
</plugin>
46-
</plugins>
47-
</pluginManagement>
48-
</build>
49-
</project>
16+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.sonatype.mavenbook.multi</groupId>
24+
<artifactId>utils-parent</artifactId>
25+
<version>0.9-MNG6957-SNAPSHOT</version>
26+
</parent>
27+
<artifactId>simple-testutils</artifactId>
28+
</project>
Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
Licensed to the Apache Software Foundation (ASF) under one
4-
or more contributor license agreements. See the NOTICE file
5-
distributed with this work for additional information
6-
regarding copyright ownership. The ASF licenses this file
7-
to you under the Apache License, Version 2.0 (the
8-
"License"); you may not use this file except in compliance
9-
with the License. You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing,
14-
software distributed under the License is distributed on an
15-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16-
KIND, either express or implied. See the License for the
17-
specific language governing permissions and limitations
18-
under the License.
19-
-->
202
<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">
213
<modelVersion>4.0.0</modelVersion>
22-
<parent>
23-
<groupId>org.sonatype.mavenbook.multi</groupId>
24-
<artifactId>utils-parent</artifactId>
25-
<version>0.9-MNG6957-SNAPSHOT</version>
26-
</parent>
4+
<groupId>org.sonatype.mavenbook.multi</groupId>
275
<artifactId>simple-testutils</artifactId>
28-
</project>
6+
<version>0.9-MNG6957-SNAPSHOT</version>
7+
</project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.sonatype.mavenbook.multi</groupId>
24+
<artifactId>simple-parent</artifactId>
25+
<version>0.9-MNG6957-SNAPSHOT</version>
26+
</parent>
27+
<artifactId>simple-weather</artifactId>
28+
<packaging>jar</packaging>
29+
30+
<name>Multi Chapter Simple Weather API</name>
31+
32+
<dependencies>
33+
<dependency>
34+
<groupId>org.sonatype.mavenbook.multi</groupId>
35+
<artifactId>simple-testutils</artifactId>
36+
<scope>test</scope>
37+
<version>0.9-MNG6957-SNAPSHOT</version>
38+
</dependency>
39+
</dependencies>
40+
41+
</project>

0 commit comments

Comments
 (0)