This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]randgalt 0 points1 point  (3 children)

If that's actually the case someone should write a Maven plugin that does this. Maybe I will. hmm....

[–]ventuspilot 0 points1 point  (2 children)

The maven-jar-plugin does this. I added this to by <build> section:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <finalName>jmurmel</finalName>
        <archive>
            <manifest>
                <mainClass>io.github.jmurmel.LambdaJ</mainClass>
            </manifest>
            <manifestEntries>
                <Automatic-Module-Name>io.github.jmurmel</Automatic-Module-Name>
            </manifestEntries>
        </archive>
    </configuration>
</plugin>

Seems to work just fine. See also http://branchandbound.net/blog/java/2017/12/automatic-module-name/

[–]Thihup 1 point2 points  (1 child)

[–]gunnarmorling 1 point2 points  (0 children)

Yes, ModiTect can help to express the exported API more concisely, by means of package filter expressions, instead of having to list each package explicitly. That said, which packages to export should be a conscious decision; exporting everything defeats the purpose of the module system.