Skip to content

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Apr 13, 2025

This PR slightly improves the file transport to fully utilize FileSystem, which now can be ZipFileSystem as well. The "old" part remains unchanged.

For factory just added bundle: prefix, that now may be in form bundle:fileUri, where fileUri is basically a path of a ZIP file that must exist. The ZIP file is read only.

The point of this PR is that user can now use a "bundle" (see https://central.sonatype.org/publish/publish-portal-upload/) just like we did before with staging repositories. Various tools (njord?) can produce bundles. The ZIP file is "mounted" and artifacts from it becomes reachable to Maven just like from any remote repository.


https://issues.apache.org/jira/browse/MRESOLVER-700

That is based on slightly improved file transport, that
uses FileSystem which can by ZIPFS or JIMFS as well.
@cstamas cstamas self-assigned this Apr 13, 2025
@cstamas cstamas marked this pull request as ready for review April 13, 2025 20:55
@cstamas cstamas added this to the 2.0.9 milestone Apr 13, 2025
@slawekjaranowski
Copy link
Member

Why bundle is read-only by default?

@cstamas
Copy link
Member Author

cstamas commented Apr 13, 2025

Initial idea is really just to disseminate the idea that one can "mount" ZIP files as remote repositories. Like repository staging, and there, the main use case is usually to perform some sort of "testing" with newly baked artifacts. This PR makes Resolver able to consume these bundle ZIP files (essentially ZIP files containing artifacts laid down on remote repo layout) with all the metadata (maven metadata, checksums, signatures, etc).

@cstamas
Copy link
Member Author

cstamas commented Apr 13, 2025

... aand after I commented, I think figured your point 😄 Yes, ultimately Resolver 2 could be used to create and read ZIP bundles. But, IMO we need to be very careful here, like we should allow "create from scratch" (like ZIP file is created from scratch) or "read created bundle", where you really just consume bundle for testing purposes. Existing ZIP bundle should not be modified, or at least, would be risky business.

Njord enforces this: it does not allow you to "export" to already existing ZIP files for example. But we should somewhere sit down and have a 🍻 that may be followed by a discussion about these things...

@cstamas
Copy link
Member Author

cstamas commented Apr 13, 2025

For example we could achieve this by some extra params:

  • by default (as in this PR) the ZIP file must exists and is read obly
  • if URL has ?create=true QP, then Resolver could enforce ZIP file does not exists, and could make it read-write (and would become usable with altDeployRepository for example).

@cstamas
Copy link
Member Author

cstamas commented Apr 14, 2025

Just one remark (somewhat related to this PR): While I worked on Njord 0.1.2 release, I figured that even if we allow bundle creation with Resolver (like the above mentioned ?create=true QP), the bundle would be usable for central publishing only, which is I think still fine. But for more advanced control and support, like bundle merging, validating for requirements, managing, etc you'd need advanced tools like Njord is. Also, this way created bundle would not be usable with Njord (lack of metadata). Still, this functionality would provide one single building block needed for Central Publishing: the ZIP bundle itself. But how user would publish it, etc, would NOT be solved.

@cstamas cstamas changed the title [MRESOLVER-700] Bundle transport [MRESOLVER-700] Bundle transport: read support Apr 14, 2025
@cstamas cstamas merged commit 156b036 into apache:master Apr 14, 2025
8 checks passed
@cstamas cstamas deleted the MRESOLVER-700 branch April 14, 2025 14:05
@jira-importer
Copy link

Resolve #1435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants