-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove first level transitive provided scope dependencies and their s…
…ubtrees (#172) * Remove first level transitive, provided scope dependencies and their subtrees * Removed accidentally included 'optional' test. * Fixed weird spacing modifications from before * Fixed weird spacing issues with PR * Fixing spacing issue Co-authored-by: Saleh Mostafa <salehmostafa@google.com>
- Loading branch information
1 parent
aa6cbd5
commit 76c8fb8
Showing
10 changed files
with
274 additions
and
2 deletions.
There are no files selected for viewing
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,17 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>parent-deps</artifactId> | ||
<version>1.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<!-- for testing purpose, normally this would be dep management --> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>dep</artifactId> | ||
<version>1.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
37 changes: 37 additions & 0 deletions
37
src/it/projects/flatten-dependency-all-depmgnt-provided-transitive/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,37 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>flatten-dependency-all-depmgnt-provided-transitive</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>dep</artifactId> | ||
<version>1.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>parent-deps</artifactId> | ||
<version>1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<configuration> | ||
<flattenDependencyMode>all</flattenDependencyMode> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
32 changes: 32 additions & 0 deletions
32
src/it/projects/flatten-dependency-all-depmgnt-provided-transitive/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 @@ | ||
/* | ||
* 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. | ||
*/ | ||
File originalPom = new File( basedir, 'pom.xml' ) | ||
assert originalPom.exists() | ||
|
||
def originalProject = new XmlSlurper().parse( originalPom ) | ||
assert 1 == originalProject.dependencies.size() | ||
|
||
File flattendPom = new File( basedir, '.flattened-pom.xml' ) | ||
assert flattendPom.exists() | ||
|
||
def flattendProject = new XmlSlurper().parse( flattendPom ) | ||
assert 1 == flattendProject.dependencies.size() | ||
assert 1 == flattendProject.dependencies.dependency.size() | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
src/it/projects/flatten-dependency-all-provided-children/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,28 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>flatten-dependency-all-depmgnt-provided-transitive</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>parent-deps</artifactId> | ||
<version>1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>verify</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<configuration> | ||
<flattenDependencyMode>all</flattenDependencyMode> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
30 changes: 30 additions & 0 deletions
30
src/it/projects/flatten-dependency-all-provided-children/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,30 @@ | ||
/* | ||
* 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. | ||
*/ | ||
File originalPom = new File( basedir, 'pom.xml' ) | ||
assert originalPom.exists() | ||
|
||
def originalProject = new XmlSlurper().parse( originalPom ) | ||
assert 1 == originalProject.dependencies.size() | ||
|
||
File flattendPom = new File( basedir, '.flattened-pom.xml' ) | ||
assert flattendPom.exists() | ||
|
||
def flattendProject = new XmlSlurper().parse( flattendPom ) | ||
assert 1 == flattendProject.dependencies.size() | ||
assert 1 == flattendProject.dependencies.dependency.size() |
28 changes: 28 additions & 0 deletions
28
src/it/projects/flatten-dependency-all-provided-direct/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,28 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>flatten-dependency-all-provided-direct</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>dep</artifactId> | ||
<version>1.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>verify</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<configuration> | ||
<flattenDependencyMode>all</flattenDependencyMode> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
33 changes: 33 additions & 0 deletions
33
src/it/projects/flatten-dependency-all-provided-direct/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,33 @@ | ||
/* | ||
* 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. | ||
*/ | ||
File originalPom = new File( basedir, 'pom.xml' ) | ||
assert originalPom.exists() | ||
|
||
def originalProject = new XmlSlurper().parse( originalPom ) | ||
assert 1 == originalProject.dependencies.size() | ||
|
||
File flattendPom = new File( basedir, '.flattened-pom.xml' ) | ||
assert flattendPom.exists() | ||
|
||
def flattenedProject = new XmlSlurper().parse( flattendPom ) | ||
assert 1 == flattenedProject.dependencies.size() | ||
assert 1 == flattenedProject.dependencies.dependency.size() | ||
|
||
String scope = flattenedProject.dependencies.dependency.scope | ||
assert "provided" == scope |
27 changes: 27 additions & 0 deletions
27
src/it/projects/flatten-dependency-all-provided-transitive/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,27 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>flatten-dependency-all-provided-transitive</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.flatten.its</groupId> | ||
<artifactId>parent-deps</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>verify</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<configuration> | ||
<flattenDependencyMode>all</flattenDependencyMode> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
30 changes: 30 additions & 0 deletions
30
src/it/projects/flatten-dependency-all-provided-transitive/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,30 @@ | ||
/* | ||
* 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. | ||
*/ | ||
File originalPom = new File( basedir, 'pom.xml' ) | ||
assert originalPom.exists() | ||
|
||
def originalProject = new XmlSlurper().parse( originalPom ) | ||
assert 1 == originalProject.dependencies.size() | ||
|
||
File flattendPom = new File( basedir, '.flattened-pom.xml' ) | ||
assert flattendPom.exists() | ||
|
||
def flattenedProject = new XmlSlurper().parse( flattendPom ) | ||
assert 1 == flattenedProject.dependencies.size() | ||
assert 1 == flattenedProject.dependencies.dependency.size() |
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