Does the version of the JPMS support module support?

I thought JPMS did not support the module version. However, when I do java --list-modules, I have the following conclusion:

java.activation@9
java.base@9
java.compiler@9
java.corba@9
java.datatransfer@9
java.desktop@9
java.instrument@9 
....

So, I can’t understand what this is @9. This version or what? If JPMS supports the module version, can I set in the module information module A that module A requires module B of a certain version?

+6
source share
3 answers

I do not understand what it is @ 9. This version or what?

Yes, this is the version of the module.

If JPMS supports the module version, can I set in the module information module A that module A requires module B of a certain version?

, . , System Module

, , . , version-selection, .

+4

@9:

JVMS 9 module_version_index Module_attribute, , requires_version_index, - , , .

( Java 9 GA) . ModuleDescriptor.Version API.

+1

Java .

, API .

, "require" , . , .

, API, , , , (, ).

maven build java- jar project.version :

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
                <execution>
                    <id>add-version-to-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>jar</executable>
                        <workingDirectory>${project.build.directory}</workingDirectory>
                        <arguments>
                            <argument>--update</argument>
                            <argument>--verbose</argument>
                            <argument>--module-version</argument>
                            <argument>${project.version}</argument>
                            <argument>--file</argument>
                            <argument>${project.build.finalName}.jar</argument>
                            <argument>-C</argument>
                            <argument>${project.build.outputDirectory}</argument>
                            <argument>.</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
</plugin>

, ,

0

All Articles