Publish and fetch a modular jar to a repository
Alan Bateman
Alan.Bateman at oracle.com
Mon Jul 16 01:53:40 PDT 2012
On 13/07/2012 18:14, Paul Sandoz wrote:
> Hi,
>
> Here is a webrev to support the publishing and fetching of modular jars from a repository:
>
> http://cr.openjdk.java.net/~psandoz/jigsaw/repo-add-jar/webrev/
>
> I resisted the temptation to make too many changes since I think this area will need to go through a significant redesign to generalize the storage of stuff on the repository (src, docs etc) and be extensible to support stuff like reverse indexes and provide a sprinkling of REST on the HTTP repository.
>
> So it just adds the feature with minimal fuss.
>
> I hacked the testing in rather quickly, it perhaps could be improved with some guidance or feedback.
>
> Paul.
Yes, the existing repository support is very much a prototype and will
likely need need to be designed/replaced in time.
Off-hand, I don't see any issue with adding modular JAR files to the
existing repository. The only thing that comes to mind is that we will
likely need to rev the module format soon to support platform specific
modules and other attributes to indicate device features/capabilities.
I'm sure that will require updating the repository catalog and we'll
need to figure out what that means for modular JAR files, if anything.
Anyway, I skimmed through the webrev and made the following notes:
ModuleFile.java - L600, I assume you meant usize.
Repository.ModuleType - probably best for the enum values to be in
uppercase.
Repository.ModuleType - L101 - typo, "consistent" -> "consists".
The fix to RemoteRepository.java to use setInstanceFollowRedirects is a
good catch, that would could easily have lurked for a long time.
In Resolver then you might want to rename "ms" as it's no longer a
ModuleSize.
PublishedRepository.java L198, the toFile() shouldn't be necessary here,
can use Files.exists(file). Same thing at L226 where you could use
Files.newInputStream. One advantage here is that there is potential for
a much more useful exception when there is an error.
On testing, then given that it's likely that the repository support will
be replaced then it should be okay to just have a test that exercises
publishing a few modular JAR files into a repository. I see you've
cloned repolist.sh so that should be sufficient for now.
-Alan.
More information about the jigsaw-dev
mailing list