Can this alternatively be solved with Java's sealed class feature? That
would require Java 17 though...

Gary

On Thu, Jul 4, 2024, 9:18 AM Alex Herbert <alex.d.herb...@gmail.com> wrote:

> The RNG component has an internal package. So to not export this in the
> module info I had to tweak the exports for moditect inherited from commons
> parent with a profile:
>
>     <profile>
>       <id>java-9-up</id>
>       <activation>
>         <jdk>[9,)</jdk>
>       </activation>
>       <build>
>         <plugins>
>           <plugin>
>             <groupId>org.moditect</groupId>
>             <artifactId>moditect-maven-plugin</artifactId>
>             <version>${commons.moditect-maven-plugin.version}</version>
>             <configuration>
>               <module>
>                 <moduleInfo>
>                   <exports>
>                     !${commons.module.name}*.internal*;
>                     *;
>                   </exports>
>                 </moduleInfo>
>               </module>
>             </configuration>
>           </plugin>
>         </plugins>
>       </build>
>     </profile>
>
> This could be integrated to commons parent. However it may affect binary
> compatibility on Java 9+ for any that do and have been released with the
> default export of all packages.
>
> Are there any other components that use internal packages?
>
> Alex
>

Reply via email to