On 09/09/16 14:23, Alex Vong wrote:
I prefer including the version. Consider the following
situation. Package foo has version A and B, both installing to path
~/.guix-profile/share/java/ (symlink to store). When the user installs
both version A and B, there will be a conflict. Please note that I do
not know java very well. Will those jar files be installed to different
locations instead of ~/.guix-profile/share/java/ if we switch to maven
later?
No. Jar-files can be placed anywhere and get resolved through the
application's classpath at runtime. The default classpath contains only
the jar files which come with the platform (i.e. are part of the
language version & standard library). The classpath for an application
has no default value; it is set through environment variable CLASSPATH
a/o arguments to the JVM.
The application classpath can include directories (bad idea) and names
of jar or zip files (better idea, especially if they have version
numbers). To entirely eliminate dependency issues, many applications
resort to packaging all dependency jars with the application and point
the classpath to "inside the application".
By the way, does java / maven has something similar to so name for abi
compatibility?
Core Java doesn't at the library (jar) level[*], though proposals have
been made since at least version 1.4 to add it to the platform. The OSGI
model which underlies e.g. the Eclipse platform is an "in Java" solution
which got very close, and semantically went way beyond soname. There was
talk of adding that to version 8 but IIRC it didn't make it.
Cheers,
Marco
[*] Needs qualification: I was hard core Javan up to version 6. I'm
extrapolating what for ages seemed to go nowhere to versions 7..9.
Hartmut Goebel <h.goe...@goebel-consult.de> writes:
Hi,
as I'm going to release patches for some java packages, I'd like to
get consent on one point:
Should java .jar-filenames include the version?
This only effects those .jar for which there is no build.xml (or
equivalent) is present and thus #:jar-file is to be specified.
The jar-files currently packaged do not include the version, but most .
jar-files build using a build.xml or maven .pom seam to include it.
OTOH, the version is already in the prefix, thus it is redundant.
What do you think?
(I personally do not care much, I just want to avoid duplicate work.)