Gradle unable to find needed imports for custom authorizer (org.xwiki.platform:xwiki-platform-oldcore:5.4.1)

Hi guys,

I’m working to write a custom authorizer for my company to use xwiki as our help tool based on this page: https://extensions.xwiki.org/xwiki/bin/view/Extension/Trusted%20authentication%20framework. I have setup a new gradle project to make the import process easier than manually copying JARs, however, when I add the needed dependency like this:

compile group: 'org.xwiki.platform', name: 'xwiki-platform-oldcore', version: '5.4.1'

, one import fails to resolve. The offending package is "org.codehaus.swizzle:swizzle-confluence:1.2-20080419’. A quick search of the maven repository does find this JAR in a public repo, but gradle is unable to pull the jar even after making sure the correct urls are added as maven repositories in my gradle file. Trying to click on the direct jar link on the maven repository page does lead to a 404 (http://maven.xwiki.org/externals/org/codehaus/swizzle/swizzle-confluence/1.2-20080419/swizzle-confluence-1.2-20080419.jar). Does anyone have any suggestions? I’m assuming that I have to use 5.4.1 based on the information available on the page. I could just download the relevant jars, but I’m really trying to avoid that if possible!

Thanks!!

If you take a look at http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-oldcore/5.4.1/xwiki-platform-oldcore-5.4.1.pom you will see that xwiki-platform-oldcore 5.4.1 does not depend on org.codehaus.swizzle:swizzle-confluence:1.2-20080419, it depends on org.codehaus.swizzle:swizzle-confluence:1.2-20080419:xwiki:jar and it’s indeed there on http://maven.xwiki.org/externals/org/codehaus/swizzle/swizzle-confluence/1.2-20080419/.

Gradle seems to be bad at taking into account dependency classifier.

Thanks! Should have realized to check the pom myself.

I was not able to get it working using gradle. The gradle file fails with an error if trying to use the :jar on the end of the dependency; using org.codehaus.swizzle:swizzle-confluence:1.2-20080419:xwikidoes allow gradle to finish running, but doesn’t seem to actually pull the depedency without doing further debugging. I tried using the artifiact {classifier “xwiki”} notation instead but that gave me errors about not having the classifier function on my gradle. For such a small java project, spending more time debugging this doesn’t make too much sense :slight_smile:

Anyway - just created a new java project with maven instead of gradle and was able to get it working on the first try. Thanks for the help Thomas!