Hi Dennis,
I am pretty sure the Confluence libs pull in the old com.atlassian.whatever packages instead of the io.atlassian.whatever.
For the Maybe thing and some other things I build myself my own compat lib with the class signature of the missing files but only with “return null” function bodies (since no implementation is needed).
Here is the jar file (you could install it into your maven repo):
https://clouless.github.io/atlassian-community-share/2024-confluence8/confluence-8-8-compat-1.0.0.zip
<dependency>
<groupId>io.codeclou</groupId>
<artifactId>confluence-8-8-compat</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
I managed to strip it down to these classed needed:
src/main/java/com/atlassian/util/concurrent/Timeout.java
src/main/java/com/atlassian/util/concurrent/Awaitable.java
src/main/java/com/atlassian/util/concurrent/TimedOutException.java
src/main/java/com/atlassian/fugue/Effect.java
src/main/java/com/atlassian/fugue/Maybe.java
src/main/java/com/atlassian/fugue/Option.java
src/main/java/com/atlassian/fugue/Either.java
In general there were some version problems with power mock and mockito.
I am currently building with Termium JDK 11 against Confluence 8.5.0 (and for test purposes against 8.8.0-beta1) with Atlassian SDK 8.2.8
<confluence.version>8.5.0</confluence.version>
<confluence.data.version>8.5.0</confluence.data.version>
<amps.version>8.10.1</amps.version>
<plugin.testrunner.version>2.0.1</plugin.testrunner.version>
<atlassian.spring.scanner.version>2.1.10</atlassian.spring.scanner.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
I managed to get everything working by using these additional dependencies with scope=test:
<dependency>
<!-- somehow fugue and concurrent stuff is missing to mock MacroDefinition -->
<groupId>io.codeclou</groupId>
<artifactId>confluence-8-8-compat</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Needed to mock com.atlassian.confluence.api.service.content.ContentService -->
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.12.6</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Needed to make Velocity work in unit tests since Confluence 8.8 -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Neded to mock MacroUtils -->
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
and for mockito
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.6.28</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.14.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
that was all up until now. I will head to build against Confluence 9 soon and are awaiting similar things
…
And what was really annoying that IntelliJ was out of sync all the time. Some “atlas-clean” and restarts of IntelliJ helped a lot 