-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-5102] Add support for POM mixins
# Conflicts: # core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
- Loading branch information
Showing
8 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5102MixinsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* 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-5135">MNG-5135</a>. | ||
* | ||
* @author Benjamin Bentmann | ||
*/ | ||
public class MavenITmng5102MixinsTest extends AbstractMavenIntegrationTestCase { | ||
|
||
public MavenITmng5102MixinsTest() { | ||
super("(4.0.0-alpha-7,)"); | ||
} | ||
|
||
/** | ||
* Verify that mixins can be loaded from the file system. | ||
* | ||
* @throws Exception in case of failure | ||
*/ | ||
@Test | ||
public void testWithPath() throws Exception { | ||
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5102-mixins/path"); | ||
|
||
Verifier verifier = newVerifier(testDir.getAbsolutePath()); | ||
verifier.setAutoclean(false); | ||
verifier.deleteDirectory("target"); | ||
verifier.deleteArtifacts("org.apache.maven.its.mng5102"); | ||
verifier.addCliArgument("install"); | ||
verifier.execute(); | ||
verifier.verifyErrorFreeLog(); | ||
} | ||
|
||
/** | ||
* Verify that mixins can be loaded from the repositories. | ||
* | ||
* @throws Exception in case of failure | ||
*/ | ||
@Test | ||
public void testWithGav() throws Exception { | ||
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5102-mixins/gav"); | ||
|
||
Verifier verifier = newVerifier(new File(testDir, "mixin-2").getAbsolutePath()); | ||
|
||
verifier.setAutoclean(false); | ||
verifier.deleteDirectory("target"); | ||
verifier.deleteArtifacts("org.apache.maven.its.mng5102"); | ||
verifier.addCliArgument("install"); | ||
verifier.execute(); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
verifier = newVerifier(new File(testDir, "project").getAbsolutePath()); | ||
verifier.setAutoclean(false); | ||
verifier.deleteDirectory("target"); | ||
verifier.addCliArgument("install"); | ||
verifier.execute(); | ||
verifier.verifyErrorFreeLog(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
core-it-suite/src/test/resources/mng-5102-mixins/gav/mixin-2/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.1.0" root="true"> | ||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>mixin-2</artifactId> | ||
<version>0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<mixin2>true</mixin2> | ||
</properties> | ||
</project> |
36 changes: 36 additions & 0 deletions
36
core-it-suite/src/test/resources/mng-5102-mixins/gav/project/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.1.0" root="true"> | ||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>gav</artifactId> | ||
<version>0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<name>Maven Integration Test :: MNG-5102</name> | ||
<description>Mixins tests.</description> | ||
|
||
<mixins> | ||
<mixin> | ||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>mixin-2</artifactId> | ||
<version>0.1</version> | ||
</mixin> | ||
</mixins> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
core-it-suite/src/test/resources/mng-5102-mixins/path/child/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project> | ||
<modelVersion>4.1.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>path</artifactId> | ||
</parent> | ||
|
||
<artifactId>child</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>Maven Integration Test :: MNG-5102 :: Child</name> | ||
<description>Mixins tests.</description> | ||
|
||
<mixins> | ||
<mixin> | ||
<relativePath>../mixins/mixin-3.xml</relativePath> | ||
</mixin> | ||
</mixins> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
core-it-suite/src/test/resources/mng-5102-mixins/path/mixins/mixin-1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>mixin-1</artifactId> | ||
<version>0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<mixin1>true</mixin1> | ||
</properties> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
core-it-suite/src/test/resources/mng-5102-mixins/path/mixins/mixin-3.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>mixin-3</artifactId> | ||
<version>0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<mixin3>true</mixin3> | ||
</properties> | ||
</project> |
40 changes: 40 additions & 0 deletions
40
core-it-suite/src/test/resources/mng-5102-mixins/path/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<project root="true"> | ||
<modelVersion>4.1.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.its.mng5102</groupId> | ||
<artifactId>path</artifactId> | ||
<version>0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<name>Maven Integration Test :: MNG-5102</name> | ||
<description>Mixins tests.</description> | ||
|
||
<modules> | ||
<module>child</module> | ||
</modules> | ||
|
||
<mixins> | ||
<mixin> | ||
<relativePath>mixins/mixin-1.xml</relativePath> | ||
</mixin> | ||
</mixins> | ||
</project> |