You can use the Java API by adding a
provided Maven dependency to the project. At runtime this dependency is provided by the Scroll Platform plugin, which is bundled and installed by both Scroll Versions and Scroll Translations.
First add the K15t Maven repository to your project or Maven settings:
<repositories> <repository> <id>k15t</id> <url>https://nexus.k15t.com/content/repositories/releases</url> </repository> </repositories>
Then add a dependency to the
pom.xml of your project:
<dependencies> ... <dependency> <groupId>com.k15t.scroll</groupId> <artifactId>scroll-content-management-api</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency> ... </dependencies>
Finally, add the following OSGi imports to the
maven-confluence-plugin configuration in your
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-confluence-plugin</artifactId> <configuration> ... <instructions> <Import-Package> com.k15t.scroll.scm.api.*;version="[1.0.0,2.0.0)", ... </Import-Package> ... </instructions> ... </configuration> </plugin>
The version range
[1.0.0,2.0.0) declares your plugin is compatible with all versions of the Java API starting from version 1.0.0, to - but not including - 2.0.0.
New major versions of the API will include breaking changes, so it's probable you'll need to adapt your source code. Don't assume your code will work out of the box with the next major version of the API.
When declaring the version range:
- Use the version of the maven dependency as the lower bound
- Use the next major version as the excluded upper bound