Could not find artifact org.xwiki.commons:xwiki-commons-job:jar:12.10.3 in xwiki-releases

Hello.

I’m upgrading my extension from 10.11.9 to 12.10.3

So I basically just changed the pom of my extension as I always do while upgrading xwiki version

  <parent>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-distribution</artifactId>
    <version>12.10.3</version>
  </parent>

And now when I building I have this error

mvn clean install -Pxwiki -U

> 
>     [INFO] --------------------------------[ jar ]---------------------------------
>     Downloading from xwiki-releases: https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/commons/xwiki-commons-job/12.10.3/xwiki-commons-job-12.10.3.jar
>     Downloading from xwiki-external: https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/commons/xwiki-commons-job/12.10.3/xwiki-commons-job-12.10.3.jar
>     Downloading from central: https://repo.maven.apache.org/maven2/org/xwiki/commons/xwiki-commons-job/12.10.3/xwiki-commons-job-12.10.3.jar
>     [INFO] ------------------------------------------------------------------------
>     [ERROR] Failed to execute goal on project xwiki-my-extension: Could not resolve dependencies for project eu.hbp.wiki:xwiki-ext-collab:jar:0.23.2: Could not find artifact org.xwiki.commons:xwiki-commons-job:jar:12.10.3 in xwiki-releases (https://nexus.xwiki.org/nexus/content/groups/public) -> [Help 1]

The pom seems to be present on the nexus

https://nexus.xwiki.org/nexus/content/groups/public/org/xwiki/commons/xwiki-commons-job/12.10.3/

Any idea ?

Thanks !

Wrong artifactId (xwiki-commons-job).

See Index of /groups/public/org/xwiki/commons/xwiki-commons-job/12.10.3 and you’ll see that the artifact is only a pom, not a jar.

Sure but the artifact must have changed. 10.11.x is very old now (> 2 years old).

For xwiki-commons-job that was perfectly working with 10.11.9, I don’t think it’s on my side

  <dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-job</artifactId>
    <version>${commons.version}</version>
  </dependency>

I have an XWiki extension and I just want to upgrade it to the last LTS version

Back in the day 2 years ago we choose to depends of

  <parent>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-distribution</artifactId>
    <version>12.10.3</version>
  </parent>

instead of

  <parent>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-pom</artifactId>
    <version>12.10.3</version>
  </parent>

I don’t really remember why but I guess there was issur with common or missing things and everything worked well with xwiki-platform-distribution so we kept this one.

This module has been cut in two in 12.5:

  • xwiki-commons-job-api
  • xwiki-commons-job-default

Extension should usually depend on the api one.

Both are wrong actually these days. I would recommend you to take a look at GitHub - xwiki-contrib/parent: Provide various parent pom.xml for contrib extensions. Depending on what exactly your extension is about you should use either parent-platform (the most common for an extension) or parent-platform-distribution (usually used for custom distributions of XWiki).

Thanks !

According to this github page my extension use platform and common dependencies so I should use parent-platform-distribution ? It seems the closest one that what I currently have because the parent of this one is xwiki-platform-distribution which is what I currently use.

But there is no 12.10.3 btw only 12.10. And for my actual version there is no 10.11.9 just 10.11 and the documentation said in more complex use case (like parent-platform-distribution) you will need the exact same version, So I wonder why using this instead of directly xwiki-platform-distribution ?

My extension is actually a whole flavor with a bundle of extension

  • Re implementing login using OAuth2 Keycloak
  • Custom front
  • some App Within Minutes
  • Our own rest API defined in xwiki
  <parent>
    <groupId>org.xwiki.contrib</groupId>
    <artifactId>parent-platform-distribution</artifactId>
    <version>12.10</version>
  </parent>

I still have with parent-platform or parent-platform-distribution the error

Failure to find org.xwiki.commons:xwiki-commons-job:jar:12.10

This xwik-commons-job was move somewhere else ? I don’t remember why I have this dependency but I use a lot of Job that I created myself in my extension so I guess that was needed.

Thanks a lot for the help :slight_smile:

edit : at the end I removed xwiki-commons-job and so far it seems to build. I encounter some other error with enforcer but I already have open an other subject for that.

No, based on those criteria you should use parent-platform as I suggested. The point of parent-platform-distribution is to create a different distribution of XWiki itself (with a custom WAR package, etc.), not an extension to install in XWiki Standard.

I think you missed my first message where I explained why you should not use xwik-commons-job anymore and what to use now.

Ha yes I missed the first message ! use parent-platform so and it works, thanks !

I noticed that there is an issue with parent-platform. Indeed I don’t need parent-platform-distribution because I don’t need to rebuild the war. But I still need to generate the last up-to-date with my own changes hibernate.cfg.xml xwiki.properties and xwiki.cfg.

For that I use a pom like this

  <properties>
    <artifact.copy.skip>false</artifact.copy.skip>
    <artifact.copy.to>configuration</artifact.copy.to>
    <artifact.copy.include>*.cfg,*.properties,*.xml,*.xar</artifact.copy.include>

    <!-- Database configuration -->
    <xwiki.db>mysql</xwiki.db>
    <xwiki.db.connection.url>jdbc:mysql://localhost/xwiki?useSSL=false</xwiki.db.connection.url>
    <xwiki.db.connection.username>xwiki</xwiki.db.connection.username>
    <xwiki.db.connection.password>xwiki</xwiki.db.connection.password>
    <xwiki.db.connection.driver_class>com.mysql.jdbc.Driver</xwiki.db.connection.driver_class>
    <xwiki.db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</xwiki.db.dialect>

    <!-- xwiki.cfg -->
    <xwiki.cfg.defaultskin>Collaboratory.UX.HbpSkin</xwiki.cfg.defaultskin>

    <xwiki.cfg.additionalproperties>
<!-- # add properties in the form of:
a.property = true
another.property = false -->
xwiki.authentication.authclass=com.xwiki.authentication.keycloak.XWikiKeycloakAuthenticator
xwiki.webapppath=
xwiki.authentication.group.allgroupimplicit=1
    </xwiki.cfg.additionalproperties>
...
</properties>

  <build>
    <plugins>
      <!-- Activate the generation of the config files -->
      <plugin>
        <groupId>org.xwiki.commons</groupId>
        <artifactId>xwiki-commons-tool-remote-resource-plugin</artifactId>
        <executions>
          <execution>
            <id>xwiki-platform-tool-configuration-resources</id>
            <phase>process-resources</phase>
            <configuration>
              <outputDirectory>${project.build.directory}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>

and this generate as expected the good version of hibernate.cfg.xml xwiki.properties and xwiki.cfg

But if i use parent-platform I don’t get this file in the target folder, if I switch to parent-platform-distribution I have them.

I don’t know if it’s an issue or made on purpose.

Those definitely are distribution stuff which don’t make much sense for most extensions since they are located in the WAR so yes you should use parent-platform-distribution.

The main difference between parent-platform and parent-platform-distribution is that the latter has xwiki-platform/xwiki-platform-distribution/pom.xml at master · xwiki/xwiki-platform · GitHub as parent and that’s where the xwiki-commons-tool-remote-resource-plugin plugin default config is located as well as xwiki.cfg.*, xwiki.properties.* and xwiki.db.* default maven properties values.

Ok thanks again !

FYI theses 2 properties doesn’t works solr.embedded.home and store.file.directory. So far I wan’t to keep like it was before solr and storage separate and not into the same store folder to fit our backup.

<!-- xwiki.properties -->
<xwiki.properties.environment.permanentDirectory>/data/xwiki/</xwiki.properties.environment.permanentDirectory>
<xwiki.properties.solr.embedded.home>${environment.permanentDirectory}/solr</xwiki.properties.solr.embedded.home>
<xwiki.properties.store.file.directory>${environment.permanentDirectory}/storage</xwiki.properties.store.file.directory>

I had to use instead, but it’s fine I report it just in case you would be interested

<xwiki.properties.additionalproperties>
solr.embedded.home=/data/xwiki/solr
store.file.directory=/data/xwiki/storage
</xwiki.properties.additionalproperties>

Most of xwiki.properties properties don’t have corresponding Maven properties actually, we just introduced a few we needed during the XWiki build.