nexus-repository-composer: Composer plugin is not working on NXRM 3.71

I tried to use composer bundle/plugin 0.0.29 with nexus repository version 3.71 but i got the following error during nexus start.

2024-08-10 20:11:16,269+0330 ERROR [FelixStartLevel]  *SYSTEM Felix - Bundle org.sonatype.nexus.extender [95] EventDispatcher: Error during dispatch. (com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for ComposerJsonProcessor annotated with interface TypeArguments$Implicit was bound.

Did you mean?
    * ComposerJsonProcessor bound at LocatorWiring

Requested by:
1  : LocatorWiring

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

1 error

======================
Full classname legend:
======================
ComposerJsonProcessor:  "org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor"
LocatorWiring:          "org.eclipse.sisu.wire.LocatorWiring"
TypeArguments$Implicit: "org.eclipse.sisu.inject.TypeArguments$Implicit"
========================
End of classname legend:
========================
)
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for ComposerJsonProcessor annotated with interface TypeArguments$Implicit was bound.

Did you mean?
    * ComposerJsonProcessor bound at LocatorWiring

Requested by:
1  : LocatorWiring

Learn more:
  https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

1 error

======================
Full classname legend:
======================
ComposerJsonProcessor:  "org.sonatype.nexus.repository.composer.internal.ComposerJsonProcessor"
LocatorWiring:          "org.eclipse.sisu.wire.LocatorWiring"
TypeArguments$Implicit: "org.eclipse.sisu.inject.TypeArguments$Implicit"
========================
End of classname legend:
========================

so the plugin is not working

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 34 (13 by maintainers)

Most upvoted comments

Apparently the code is okay and I just uploaded the wrong bundle. But anyway, I’ve added a unit test for this and ran a clean build.

nexus-repository-composer-2184cce.zip

Obviously. 3.71 dropped OrientDB support and this plugin is several versions behind, so quite a few transitions to new internal structures to be done.

  • missing H2/PostgreSQL DB schema support
  • migration to new APIs required
  • missing migration strategy (unsure if that will ever be done without additional tooling effort)

I tried to get into it and start migration (see #158), but this will take some time and does not have any priority on my side.

Current status: plugin starts, tables are created, hosted repository works mostly (cleanup and deletion to be done)

This one’s built from https://github.com/stklcode/nexus-repository-composer/commit/23ddc10605dab0d13ddc20f7deb1c2d358fa8b49 Not much difference from the previous version, some minor fix and working integration tests.

[removed old link, see new version below]

I’m currently looking into layout migration. I do have some other points in mind that would be nice to adjust, bug I don’t want to get this too big at this point, so we actually have a chance to get the update released.

Looking at NPM the node above the tarballs is actually a PACKAGE_ROOT node which is somewhat equivalent to our PACKAGE asset. With provider and package JSON it might also be a possibility to move these out of p/p2 and place them next to the ZIPBALLs

/
├─ vendor1
│  └─ package1
│     ├─ package.json
│     ├─ provider.json
│     ├─ vendor1-package1-v1.zip
│     └─ vendor1-package1-v2.zip

or maybe

├─ vendor1
│  └─ package1
│     ├─ package.json
│     ├─ provider.json
│     ├─ v1
│     │  └─vendor1-package1-v1.zip
│     └─ v2
│        └─ vendor1-package1-v2.zip
└─ vendor2
   └─ ...

(actual package/provider URLs have to remain at p/p2 of course)

Layout could also be migrated in a following change with a corresponding migration step, it’s just some URL replacement in the BrowseNode and/or Component paths.

Got it. In both cases I just had to remove a leading / again, in the internal package path for the proxy and in the frontend JavaScript for the links. Database entries look fine.

[removed old version, see below]

Thanks for testing! Good catch.

Missed one leading slash, so fetching <upstream>//packages/list.json (for proxy packages.json is internally built from list.json) returns 404 from packagist.org and then there is this (old) TODO “Better logging and error checking” …

Fixed that one: [removed old version link, see below]

This one is built from https://github.com/sonatype-nexus-community/nexus-repository-composer/pull/158/commits/527a512a737cd32c3ba11478979cef77da98c690 using OpenJDK 17.0.12

Use at own risk 😉 [removed old version link, see below] (extract the ZIP, KAR files are not supported for upload here)

Already mentioned, but like overread… It does not support migration from OrientDB to H2 (or at least I did not test it) I performed a scripted export and uploaded all ZIPs to the new hosted repo for now.

Update from my side:

Think I’m mostly done with the migration. As far as my tests tell me, the project is now on par with the 0.29 state.

  • hosted repo works including upload mask and cleanup
    • some minor improvements to package/provider file generation and removal
    • new feature: list.json with filter support
  • proxy repo works … except for the actual zipballs, but I don’t think they worked before
  • group repo works

I’d appreciate testing, if anyone is willing to do it. Can attach a snapshot JAR or KAR, if requested.