Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2237

It is not possible to install a XAR extension directly from a Maven repository accessible through custom HTTP headers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 13.4, 12.10.8
    • Extension
    • None
    • Unknown

    Description

      Steps to reproduce : 

      • Create a new instance, make sure that at least one of its extension repositories is a Maven repository requiring custom HTTP headers for authentication, that contains a XAR artifact that is not present in the other repositories
      • In the administration, use the "Advanced search" of the extension manager to search for the artifact, with its ID and version
      • Observe that the extension is correctly displayed in the search results
      • Try to install the extension

      The install plan will actually fail with the following error : 

      
      Could not find extension [my.super.extension:my-artifact/1.0-SNAPSHOT]
      class org.xwiki.extension.InstallException: Failed to resolve extension [my.super.extension:my-artifact/1.0-SNAPSHOT]
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.resolveExtension(AbstractInstallPlanJob.java:891)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:849)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:316)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:284)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.start(AbstractInstallPlanJob.java:207)
          at org.xwiki.extension.job.internal.InstallPlanJob.runInternal(InstallPlanJob.java:88)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:243)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:220)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: class org.xwiki.extension.ExtensionNotFoundException: Could not find extension [my.super.extension:my-artifact/1.0-SNAPSHOT]
          at org.xwiki.extension.repository.internal.DefaultExtensionRepositoryManager.resolve(DefaultExtensionRepositoryManager.java:301)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.resolveExtension(AbstractInstallPlanJob.java:889)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:849)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:316)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.installExtension(AbstractInstallPlanJob.java:284)
          at org.xwiki.extension.job.internal.AbstractInstallPlanJob.start(AbstractInstallPlanJob.java:207)
          at org.xwiki.extension.job.internal.InstallPlanJob.runInternal(InstallPlanJob.java:88)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:243)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:220)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      

      At first glance, the issue comes form the AbstractInstallPlanJob, trying to resolve the extension : https://github.com/xwiki/xwiki-commons/blob/365a3630df6931316ced9c812307213b01211fe7/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/AbstractInstallPlanJob.java#L889

      For Maven-based repositories, we'll eventually end up calling AetherUtils here : https://github.com/xwiki/xwiki-commons/blob/365a3630df6931316ced9c812307213b01211fe7/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-repositories/xwiki-commons-extension-repository-maven/src/main/java/org/xwiki/extension/repository/aether/internal/AetherExtensionRepository.java#L527 … which will create an Artifact for the extension with the type "jar" instead of "xar".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              caubin Clément Aubin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: