Skip to content

Commit 75463c5

Browse files
committed
[MSHADE-326] Hide shaded dependencies from the rest of the reactor build
1 parent 6fd4581 commit 75463c5

File tree

9 files changed

+451
-0
lines changed

9 files changed

+451
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project>
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.apache.maven.its.shade.drp</groupId>
27+
<artifactId>project-parent</artifactId>
28+
<version>1.0</version>
29+
</parent>
30+
31+
<artifactId>commandline</artifactId>
32+
<packaging>jar</packaging>
33+
34+
<name>MSHADE-326</name>
35+
<description>
36+
Test to see that the reduced dependencies are gone from the reactor.
37+
</description>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>org.apache.maven.its.shade.drp</groupId>
42+
<artifactId>library</artifactId>
43+
<version>${project.version}</version>
44+
</dependency>
45+
</dependencies>
46+
47+
<build>
48+
<plugins>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-shade-plugin</artifactId>
52+
<version>@project.version@</version>
53+
<executions>
54+
<execution>
55+
<id>attach-shade</id>
56+
<phase>package</phase>
57+
<goals>
58+
<goal>shade</goal>
59+
</goals>
60+
</execution>
61+
</executions>
62+
</plugin>
63+
</plugins>
64+
</build>
65+
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package nl.example;
21+
22+
public class Main
23+
{
24+
public static void main( String[] args ) {
25+
System.out.println( "Hello World!" + ( StringTester.isEmpty("foo") ? " is empty!" : " -- ") );
26+
}
27+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.goals = clean package
19+
invoker.java.version = 1.8+
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project>
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.apache.maven.its.shade.drp</groupId>
27+
<artifactId>project-parent</artifactId>
28+
<version>1.0</version>
29+
</parent>
30+
31+
<artifactId>library</artifactId>
32+
<packaging>jar</packaging>
33+
34+
<name>MSHADE-326</name>
35+
<description>
36+
Test to see that the reduced dependencies are gone from the reactor.
37+
</description>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>org.codehaus.plexus</groupId>
42+
<artifactId>plexus-utils</artifactId>
43+
<version>1.4.1</version>
44+
</dependency>
45+
</dependencies>
46+
47+
<build>
48+
<plugins>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-shade-plugin</artifactId>
52+
<version>@project.version@</version>
53+
<executions>
54+
<execution>
55+
<id>attach-shade</id>
56+
<phase>package</phase>
57+
<goals>
58+
<goal>shade</goal>
59+
</goals>
60+
<configuration>
61+
<minimizeJar>true</minimizeJar>
62+
<createDependencyReducedPom>true</createDependencyReducedPom>
63+
<useDependencyReducedPomInJar>true</useDependencyReducedPomInJar>
64+
<hideReducedDependenciesInReactor>true</hideReducedDependenciesInReactor>
65+
<relocations>
66+
<relocation>
67+
<pattern>org.codehaus.plexus</pattern>
68+
<shadedPattern>nl.example.shaded.org.codehaus.plexus</shadedPattern>
69+
</relocation>
70+
</relocations>
71+
<artifactSet>
72+
<includes>
73+
<include>org.codehaus.plexus:plexus-utils</include>
74+
</includes>
75+
</artifactSet>
76+
</configuration>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
</project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package nl.example;
21+
22+
import org.codehaus.plexus.util.StringUtils;
23+
24+
public class StringTester
25+
{
26+
public static boolean isEmpty( String input ) {
27+
return StringUtils.isEmpty( input );
28+
}
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package nl.example;
21+
22+
import org.junit.Test;
23+
24+
import static org.junit.Assert.assertTrue;
25+
import static org.junit.Assert.assertFalse;
26+
27+
public class TestStringTester
28+
{
29+
@Test
30+
public void runTest()
31+
{
32+
assertTrue(StringTester.isEmpty(""));
33+
assertFalse(StringTester.isEmpty("FooBar"));
34+
}
35+
36+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project>
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.apache.maven.plugins.shade.its</groupId>
27+
<artifactId>shade-parent</artifactId>
28+
<version>1.0</version>
29+
<relativePath>../setup-parent</relativePath>
30+
</parent>
31+
32+
<groupId>org.apache.maven.its.shade.drp</groupId>
33+
<artifactId>project-parent</artifactId>
34+
<packaging>pom</packaging>
35+
36+
<name>MSHADE-326</name>
37+
<description>
38+
Test to see that the reduced dependencies are gone from the reactor.
39+
</description>
40+
41+
<properties>
42+
<maven.compiler.source>1.8</maven.compiler.source>
43+
<maven.compiler.target>1.8</maven.compiler.target>
44+
</properties>
45+
46+
<dependencies>
47+
<dependency>
48+
<groupId>junit</groupId>
49+
<artifactId>junit</artifactId>
50+
<version>4.12</version>
51+
<scope>test</scope>
52+
</dependency>
53+
</dependencies>
54+
55+
<build>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.apache.maven.plugins</groupId>
59+
<artifactId>maven-compiler-plugin</artifactId>
60+
<version>3.8.0</version>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
65+
<modules>
66+
<module>library</module>
67+
<module>commandline</module>
68+
</modules>
69+
70+
</project>

0 commit comments

Comments
 (0)