diff --git a/src/it/MCOMPILER-372_modularized_testjar/invoker.properties b/src/it/MCOMPILER-372_modularized_testjar/invoker.properties new file mode 100644 index 00000000..668d5c4c --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/invoker.properties @@ -0,0 +1,21 @@ +# 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. + +## For remote debug +#invoker.mavenOpts = -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 + +invoker.goals = clean test diff --git a/src/it/MCOMPILER-372_modularized_testjar/pom.xml b/src/it/MCOMPILER-372_modularized_testjar/pom.xml new file mode 100644 index 00000000..25536df4 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/pom.xml @@ -0,0 +1,56 @@ + + + + + 4.0.0 + + org.apache.maven.plugins.compiler.it.372 + mcompiler-372 + 1.0-SNAPSHOT + pom + + + UTF-8 + + + + prj0 + prj1 + prj2 + prj3 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + @project.version@ + + 11 + 11 + + + + + diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj0/pom.xml b/src/it/MCOMPILER-372_modularized_testjar/prj0/pom.xml new file mode 100644 index 00000000..f0eb0dbc --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj0/pom.xml @@ -0,0 +1,132 @@ + + + + + 4.0.0 + + This project tests a JAXB XSD to java test compilation + + + org.apache.maven.plugins.compiler.it.372 + mcompiler-372 + 1.0-SNAPSHOT + + + prj0-372 + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + jaxb2-maven-plugin + 2.5.0 + + + + + config + + xjc + + + + + src/main/resources/prj0/Prj0Conf.xsd + + prj0.conf + ${project.build.directory}/generated-sources/xjcConf + + + + + + + + + + + + + + + org.apache.logging.log4j + log4j-api + 2.12.1 + + + + org.apache.logging.log4j + log4j-core + 2.12.1 + + + + + javax.xml.bind + jaxb-api + 2.3.1 + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + + + com.sun.xml.bind + jaxb-impl + 2.3.1 + + + + javax.activation + activation + 1.1.1 + + + + junit + junit + 3.8.2 + test + + + + + diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/module-info.java b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/module-info.java new file mode 100644 index 00000000..2c1aba25 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/module-info.java @@ -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. + */ + +module prj0_372 { + + exports prj0; + + // For log4j + requires transitive org.apache.logging.log4j; + + // For JAXB compilation + requires transitive java.xml; + requires transitive java.xml.bind; + requires transitive java.activation; + +} \ No newline at end of file diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/prj0/Dummy.java b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/prj0/Dummy.java new file mode 100644 index 00000000..a1311b39 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/java/prj0/Dummy.java @@ -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. + */ + +package prj0; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Dummy +{ + + public static final Logger LOGGER = LogManager.getLogger( Dummy.class ); + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/resources/prj0/Prj0Conf.xsd b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/resources/prj0/Prj0Conf.xsd new file mode 100644 index 00000000..b46e2eae --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/main/resources/prj0/Prj0Conf.xsd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj0/src/test/java/prj0/Prj0Test.java b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/test/java/prj0/Prj0Test.java new file mode 100644 index 00000000..84fa4071 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj0/src/test/java/prj0/Prj0Test.java @@ -0,0 +1,35 @@ +/* + * 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 prj0; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import junit.framework.TestCase; + +public class Prj0Test extends TestCase +{ + + public static final Logger LOGGER = LogManager.getLogger( Prj0Test.class ); + + public void test() { + + } + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj1/pom.xml b/src/it/MCOMPILER-372_modularized_testjar/prj1/pom.xml new file mode 100644 index 00000000..174380ac --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj1/pom.xml @@ -0,0 +1,83 @@ + + + + + 4.0.0 + + + org.apache.maven.plugins.compiler.it.372 + mcompiler-372 + 1.0-SNAPSHOT + + + prj1-372 + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + + + + + + + org.apache.logging.log4j + log4j-api + 2.12.1 + + + + org.apache.logging.log4j + log4j-core + 2.12.1 + + + + + junit + junit + 3.8.2 + test + + + + + + diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/module-info.java b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/module-info.java new file mode 100644 index 00000000..f44230a6 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/module-info.java @@ -0,0 +1,24 @@ +/* + * 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. + */ + +module prj1_372 { + + exports prj1; + +} \ No newline at end of file diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/prj1/Dummy.java b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/prj1/Dummy.java new file mode 100644 index 00000000..fe753214 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/main/java/prj1/Dummy.java @@ -0,0 +1,25 @@ +/* + * 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 prj1; + +public class Dummy +{ + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj1/src/test/java/prj1/Prj1Test.java b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/test/java/prj1/Prj1Test.java new file mode 100644 index 00000000..47178c96 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj1/src/test/java/prj1/Prj1Test.java @@ -0,0 +1,35 @@ +/* + * 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 prj1; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import junit.framework.TestCase; + +public class Prj1Test extends TestCase +{ + + public static final Logger LOGGER = LogManager.getLogger( Prj1Test.class ); + + public void test() { + + } + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj2/pom.xml b/src/it/MCOMPILER-372_modularized_testjar/prj2/pom.xml new file mode 100644 index 00000000..121beb38 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj2/pom.xml @@ -0,0 +1,87 @@ + + + + + 4.0.0 + + + org.apache.maven.plugins.compiler.it.372 + mcompiler-372 + 1.0-SNAPSHOT + + + prj2-372 + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + + + + + + org.apache.maven.plugins.compiler.it.372 + prj1-372 + 1.0-SNAPSHOT + + + + + org.apache.maven.plugins.compiler.it.372 + prj1-372 + 1.0-SNAPSHOT + tests + test + + + + junit + junit + 3.8.2 + test + + + + + diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/module-info.java b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/module-info.java new file mode 100644 index 00000000..f338c8ca --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + +module prj2_372 { + + requires prj1_372; + + exports prj2; + +} \ No newline at end of file diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/prj2/Dummy.java b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/prj2/Dummy.java new file mode 100644 index 00000000..d666a2bf --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/main/java/prj2/Dummy.java @@ -0,0 +1,25 @@ +/* + * 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 prj2; + +public class Dummy +{ + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj2/src/test/java/prj2/Prj2Test.java b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/test/java/prj2/Prj2Test.java new file mode 100644 index 00000000..c0434926 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj2/src/test/java/prj2/Prj2Test.java @@ -0,0 +1,41 @@ +/* + * 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 prj2; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import prj1.Prj1Test; + +public class Prj2Test extends Prj1Test +{ + + public static final Logger LOGGER = LogManager.getLogger( Prj2Test.class ); + + public Prj2Test() { + super(); + } + + @Override + public void test() { + + } + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj3/pom.xml b/src/it/MCOMPILER-372_modularized_testjar/prj3/pom.xml new file mode 100644 index 00000000..52514c2f --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj3/pom.xml @@ -0,0 +1,74 @@ + + + + + 4.0.0 + + + org.apache.maven.plugins.compiler.it.372 + mcompiler-372 + 1.0-SNAPSHOT + + + prj3-372 + + + + + org.apache.maven.plugins.compiler.it.372 + prj2-372 + 1.0-SNAPSHOT + + + + + org.apache.maven.plugins.compiler.it.372 + prj2-372 + 1.0-SNAPSHOT + tests + test + + + + org.apache.maven.plugins.compiler.it.372 + prj1-372 + 1.0-SNAPSHOT + tests + test + + + + junit + junit + 3.8.2 + test + + + + + diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/module-info.java b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/module-info.java new file mode 100644 index 00000000..0da57e20 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +module prj3_372 { + + requires prj1_372; + requires prj2_372; + +} \ No newline at end of file diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/prj3/Dummy.java b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/prj3/Dummy.java new file mode 100644 index 00000000..bc61e590 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/main/java/prj3/Dummy.java @@ -0,0 +1,25 @@ +/* + * 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 prj3; + +public class Dummy +{ + +} diff --git a/src/it/MCOMPILER-372_modularized_testjar/prj3/src/test/java/prj3/Prj3Test.java b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/test/java/prj3/Prj3Test.java new file mode 100644 index 00000000..0dac72f9 --- /dev/null +++ b/src/it/MCOMPILER-372_modularized_testjar/prj3/src/test/java/prj3/Prj3Test.java @@ -0,0 +1,47 @@ +/* + * 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 prj3; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import prj1.Prj1Test; +import prj2.Prj2Test; + +/** + * We want to test that import of 2 levels of modularized test projects is OK + */ +public class Prj3Test extends Prj2Test +{ + + public static final Logger LOGGER = LogManager.getLogger( Prj3Test.class ); + + private Prj1Test prj1Test = new Prj1Test(); + + public Prj3Test() { + super(); + } + + @Override + public void test() { + + } + +} diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index b199e24d..371385c1 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -488,6 +488,12 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { @Parameter(defaultValue = "${project}", readonly = true, required = true) private MavenProject project; + /** + * Reactor projects list + */ + @Parameter( defaultValue = "${reactorProjects}", readonly = true, required = true ) + private List reactorProjects; + /** * Strategy to re use javacc class created: *