Skip to content

Commit 6b86381

Browse files
authored
Parser for module-info-patch.maven files (apache#963)
The `module-info-patch.maven` files are intended to make easier to specify `--add-exports` and similar options.
1 parent 2197c22 commit 6b86381

File tree

25 files changed

+1294
-84
lines changed

25 files changed

+1294
-84
lines changed

src/it/modular-sources/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@
5151
<sources>
5252
<source>
5353
<module>org.foo</module>
54-
<directory>src/java/org.foo/main</directory>
54+
<directory>src/org.foo/main/java</directory>
5555
</source>
5656
<source>
5757
<module>org.foo</module>
58-
<directory>src/java/org.foo/test</directory>
58+
<directory>src/org.foo/test/java</directory>
5959
<scope>test</scope>
6060
</source>
6161
<source>
6262
<module>org.bar</module>
63-
<directory>src/java/org.bar/main</directory>
63+
<directory>src/org.bar/main/java</directory>
6464
</source>
6565
<source>
6666
<module>org.bar</module>
67-
<directory>src/java/org.bar/test</directory>
67+
<directory>src/org.bar/test/java</directory>
6868
<scope>test</scope>
6969
</source>
7070
</sources>
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 compile test-compile
19+
invoker.buildResult = success

src/it/module-info-patch/pom.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 http://maven.apache.org/xsd/maven-4.1.0.xsd">
21+
<modelVersion>4.1.0</modelVersion>
22+
<groupId>org.apache.maven.plugins</groupId>
23+
<artifactId>module-info-patch</artifactId>
24+
<version>1.0-SNAPSHOT</version>
25+
<packaging>jar</packaging>
26+
<name>Modular project with module-info-patch files</name>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.junit.jupiter</groupId>
31+
<artifactId>junit-jupiter-api</artifactId>
32+
<version>5.8.2</version>
33+
<scope>test</scope>
34+
</dependency>
35+
</dependencies>
36+
37+
<build>
38+
<plugins>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-compiler-plugin</artifactId>
42+
<version>@project.version@</version>
43+
<configuration>
44+
<!-- TODO: remove source and target after we identified where Maven inherits those values. -->
45+
<source />
46+
<target />
47+
</configuration>
48+
</plugin>
49+
</plugins>
50+
51+
<sources>
52+
<source>
53+
<module>org.foo</module>
54+
<directory>src/org.foo/main/java</directory>
55+
</source>
56+
<source>
57+
<module>org.foo</module>
58+
<directory>src/org.foo/test/java</directory>
59+
<scope>test</scope>
60+
</source>
61+
<source>
62+
<module>org.bar</module>
63+
<directory>src/org.bar/main/java</directory>
64+
</source>
65+
<source>
66+
<module>org.bar</module>
67+
<directory>src/org.bar/test/java</directory>
68+
<scope>test</scope>
69+
</source>
70+
</sources>
71+
</build>
72+
</project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
package bar;
20+
21+
public class App {
22+
public static void main(String[] args) {
23+
System.out.println("Bar");
24+
}
25+
}

0 commit comments

Comments
 (0)