You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Patrick (Jira)" <ji...@apache.org> on 2020/06/25 19:19:00 UTC

[jira] [Created] (MCOMPILER-422) multi release jar issue exporting release version only packages

John Patrick created MCOMPILER-422:
--------------------------------------

             Summary: multi release jar issue exporting release version only packages
                 Key: MCOMPILER-422
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-422
             Project: Maven Compiler Plugin
          Issue Type: Improvement
    Affects Versions: 3.8.1
            Reporter: John Patrick


I'm having to add ModuleInfoHack.java in empty packages so that compiler works, then do excludes **/ModuleInfoHack.java at package time.

The simplest example is;
{code}
src/main/java/package/a/Example1.java (1)
src/main/java/package/b/Example2.java (2)
src/main/java11/package/b/Example2.java (3)
src/main/java11/module-info.java (4)
{code}

With module-info.java looking like;
{code}
module MODULE_A {
    exports package.a;
    exports package.b;
}
{code}

I get compile errors so I need to create this structure adding (5);
{code}
src/main/java/package/a/Example1.java (1)
src/main/java/package/b/Example2.java (2)
src/main/java11/package/a/ModuleInfoHack.java (5)
src/main/java11/package/b/Example2.java (3)
src/main/java11/module-info.java (4)
{code}

The maven compiler plugin has this configuration;
{code}
					<executions>
						<execution>
							<id>java11-main</id>
							<phase>compile</phase>
							<goals>
								<goal>compile</goal>
							</goals>
							<configuration>
								<release>11</release>
								<jdkToolchain>
									<version>11</version>
								</jdkToolchain>
								<compileSourceRoots>
									<compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
								</compileSourceRoots>
								<multiReleaseOutput>true</multiReleaseOutput>
							</configuration>
						</execution>
					</executions>
{code}

Similar to MCOMPILER-412 it would be useful and fix my issues if target/classes is added to the compiler when doing this compiler execution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)