forked from release-engineering/pom-manipulation-ext
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue release-engineering#319 Improve inheritance resolving when inje…
…cting plugin pom
- Loading branch information
Showing
7 changed files
with
255 additions
and
35 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
integration-test/src/it/remote-plugin-management-wildfly/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,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2012 Red Hat, Inc. (jcasey@redhat.com) | ||
Licensed 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.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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.commonjava.maven.ext</groupId> | ||
<artifactId>remote-plugin-management-wildfly</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>Test override plugin version using command line property</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>99-bad</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>1000-bad</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
32 changes: 32 additions & 0 deletions
32
...-test/src/it/remote-plugin-management-wildfly/src/main/java/test/HelloWorldwithJUnit.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,32 @@ | ||
/** | ||
* Copyright (C) 2012 Red Hat, Inc. (jcasey@redhat.com) | ||
* | ||
* Licensed 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 test; | ||
|
||
import org.junit.Test; | ||
|
||
public class HelloWorldwithJUnit | ||
{ | ||
public static void main (String [] args) | ||
{ | ||
System.out.println("hello"); | ||
} | ||
|
||
@Test | ||
public void test() | ||
{ | ||
// Just a dummy method to verify that we can compile again JUnit 4 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
integration-test/src/it/remote-plugin-management-wildfly/test.properties
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,20 @@ | ||
# | ||
# Copyright (C) 2012 Red Hat, Inc. (jcasey@redhat.com) | ||
# | ||
# Licensed 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. | ||
# | ||
|
||
|
||
# Override the version of maven compiler plugin | ||
# The colon needs to be escaped to prevent the invoker plugin from misinterpreting it | ||
pluginManagement=org.wildfly.core\:wildfly-core-parent\:2.0.10.Final |
32 changes: 32 additions & 0 deletions
32
integration-test/src/it/remote-plugin-management-wildfly/verify.groovy
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,32 @@ | ||
/** | ||
* Copyright (C) 2012 Red Hat, Inc. (jcasey@redhat.com) | ||
* | ||
* Licensed 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. | ||
*/ | ||
def pomFile = new File( basedir, 'pom.xml' ) | ||
System.out.println( "Slurping POM: ${pomFile.getAbsolutePath()}" ) | ||
|
||
def pom = new XmlSlurper().parse( pomFile ) | ||
|
||
def plugin = pom.build.pluginManagement.plugins.plugin.find { it.artifactId.text() == "maven-compiler-plugin" } | ||
assert plugin != null | ||
assert plugin.version.text() == "3.1" | ||
|
||
def message = 0 | ||
pomFile.eachLine { | ||
if (it.contains( "maven-jar-plugin")) { | ||
message++ | ||
} | ||
} | ||
|
||
assert message == 1 |
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
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
Oops, something went wrong.