sonatype-nexus-community / nexus-repository-apt

A Nexus Repository 3 plugin that allows usage of apt repositories
Eclipse Public License 1.0
105 stars 50 forks source link

not compatible with new nexus-3.9.0-01 #37

Closed aplsms closed 6 years ago

aplsms commented 6 years ago

Thanks for creating an issue! Please fill out this form so we can be sure to have all the information we need, and to minimize back and forth.

Compiling of plugin with nexus-3.9.0-01 is failing.

[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /nexus-repository-apt-master/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java:[39,16] 1. ERROR in /nexus-repository-apt-master/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java (at line 39)
    protected void deleteAssetTx(EntityId assetId) {
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method deleteAssetTx(EntityId) of type AptHostedComponentMaintenanceFacet must override or implement a supertype method

[ERROR] /nexus-repository-apt-master/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java:[46,7] 2. ERROR in /nexus-repository-apt-master/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java (at line 46)
    super.deleteAssetTx(assetId);
          ^^^^^^^^^^^^^
The method deleteAssetTx(EntityId, boolean) in the type DefaultComponentMaintenanceImpl is not applicable for the arguments (EntityId)

[ERROR] Found 2 errors and 0 warnings.
derjohn commented 6 years ago

+1 here. Building with mvn, not with docker.

derjohn commented 6 years ago

Tried with docker, too, same issue.

derjohn commented 6 years ago
diff --git a/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java b/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java
index 88e7eba..202c932 100644
--- a/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java
+++ b/src/main/java/net/staticsnow/nexus/repository/apt/internal/hosted/AptHostedComponentMaintenanceFacet.java
@@ -36,14 +36,14 @@ public class AptHostedComponentMaintenanceFacet
 {
   @Transactional(retryOn = ONeedRetryException.class)
   @Override
-  protected void deleteAssetTx(EntityId assetId) {
+  protected void deleteAssetTx(EntityId assetId, boolean deleteBlobs) {
     StorageTx tx = UnitOfWork.currentTx();
     Asset asset = tx.findAsset(assetId, tx.findBucket(getRepository()));
     if (asset == null) {
       return;
     }
     String assetKind = asset.formatAttributes().get(P_ASSET_KIND, String.class);
-    super.deleteAssetTx(assetId);
+    super.deleteAssetTx(assetId, true);
     if ("DEB".equals(assetKind)) {
       try {
         getRepository().facet(AptHostedFacet.class)

I have no idea what boolean deleteBlobs does in that context, but this way it compiles.

collinpeters commented 6 years ago

The deleteBlobs boolean is for some upcoming functionality on moving components between repos in the same blob store. Apologies for breaking the signature on that method! We left behind proper signatures for deleteComponent and deleteAsset but not deleteComponentTx and deleteAssetTx.

Passing true is the correct solution so the above fix is correct.

DarthHater commented 6 years ago

Thanks @collinpeters !!!

mpoindexter commented 6 years ago

Newer builds work with newer versions of Nexus, so closing this out

aplsms commented 6 years ago

Mike,

Could you please point me to proper docker image?

https://hub.docker.com/r/sonatype/nexus3/tags/ https://hub.docker.com/r/sonatype/nexus3/tags/

Latest Image updated 1 month ago.


Andrii Petrenko aplsms@gmail.com

On May 15, 2018, at 20:13, Mike Poindexter notifications@github.com wrote:

Newer builds work with newer versions of Nexus, so closing this out

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sonatype-nexus-community/nexus-repository-apt/issues/37#issuecomment-389381293, or mute the thread https://github.com/notifications/unsubscribe-auth/ACM-Mn0Ar8oZV_m2vWt4ZAGOVp5vkomvks5ty5lHgaJpZM4SZK27.

mpoindexter commented 6 years ago

Not sure what you're asking. Proper docker image for what? If you mean the docker image that works with the latest version of the code, the master branch works with Nexus 3.11 right now.