Spring Asciidoctor Extensions not in correct repo?

680 views Asked by At

Good afternoon guys,

I've been trying to get spring-asciidoctor-extensions to work with my documentation but for some reason maven can't find the dependency.

The error i got after my build attempt:

Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.5:process-asciidoc (generate-docs) on project organization: Execution generate-docs of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.5:process-asciidoc failed: Plugin org.asciidoctor:asciidoctor-maven-plugin:1.5.5 or one of its dependencies could not be resolved: Failure to find io.spring.asciidoctor:spring-asciidoctor-extensions:jar:0.1.1.RELEASE in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

I checked thier GitHub and looked around to find out that theres nothing in the maven repo (obvious from error) and in this question found that the repo is in https://repo.spring.io/release. Is there a way to reference a dependency to a repo directly? If not what can i do?

2

There are 2 answers

1
glytching On

You can add the repo.spring.io repository to your pom.xml.

<repositories>
    <repository>
        <id>spring-repo</id>
        <url>https://repo.spring.io/release</url>
    </repository>
</repositories>

With that declaration in place you will be able to resolve this dependency:

    <dependency>
        <groupId>io.spring.asciidoctor</groupId>
        <artifactId>spring-asciidoctor-extensions</artifactId>
        <version>0.1.1.RELEASE</version>
    </dependency>

More details in the docs.

Note: it is not possible to explicitly associate this dependency with that repository. Maven walks through the repositories in order of their declaration until a given dependency is resolved (or not) however if all of your other dependencies are resolved from Maven Central then the only dependency left to be resolved from repo.spring.io will be spring-asciidoctor-extensions.

0
Christian Frommeyer On

I ran into this issue as well. My misconception at first was that I expected the dependencies to be resolved from the repositories section. However turns out that it's rather the pluginRepositories section. Like so:

<pluginRepositories>
    <pluginRepository>
        <id>spring-repo</id>
        <url>https://repo.spring.io/release</url>
    </pluginRepository>
</pluginRepositories>