Com.google.code.gson:gson is a banned dependency

Hello! Working on 8.9 compatibility (and preparing for 9.0 compatibility), I updated to AMPS 8.15.0, go to build, and:

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
make sure platform artifacts are not bundled into plugin
Found Banned Dependency: com.google.code.gson:gson:jar:2.10.1
Use 'mvn dependency:tree' to locate the source of banned dependencies.

I’m slightly confused, as com.google.code.gson:gson is at compile scope in accordance with https://developer.atlassian.com/server/confluence/get-your-apps-ready-for-gray-api-removal/.

I’m aware I can banningExcludes as per: Confluence 8.8 release EAP available now - #77 by scott.dudley.

My question is though, was banning gson intentional, will it stay? Or are the bans on this version of AMPS overzealous? Am I misunderstanding here? I don’t want to add some banningExcludes to my pom that I’ll end up removing again.

You need to exclude it from banning, yes. The banning restriction was added a few years back to prevent people from accidentally bundling artifacts that were part of the base platform.

AMPS and the SDK are bordering on unmaintained, so the default configuration of the toolkit no longer tracks the current requirements for platform 7, which now requires the opposite of earlier platform versions (that these artifacts be bundled).

There is no guarantee that Atlassian will not reverse their decision on a specific artifact (for example, the Jackson API and some of the Apache commons stuff were re-exported), but it feels to me like Guava/Gson are on their way out for good.

1 Like