Ошибка Maven - ошибка версии для плагина - PullRequest
0 голосов
/ 07 августа 2020

Я пытаюсь добавить swagger ui и следовать this .

Я добавляю плагин:

<plugin>
    <groupId>com.google.code.maven-replacer-plugin</groupId>
    <artifactId>replacer</artifactId>
    <executions>
        <execution>
            <id>replace-swagger-json-location</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>replace</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <file>${project.build.directory}/todo/docs/index.html</file>
        <replacements>
            <replacement>
                <token>https://petstore.swagger.io/v2/swagger.json</token>
                <value>/todo/api/swagger.json</value>
            </replacement>
        </replacements>
    </configuration>
</plugin>

Когда я делаю пакет maven, я получаю следующая ошибка:

[ERROR] Ошибка при разрешении версии для плагина com.google.code.maven-replacer-plugin: replacer из репозиториев [local (/Users/richardmarais/.m2/ репозиторий), центральный (https://repo.maven.apache.org/maven2)]: плагин не найден ни в одном репозитории плагинов -> [Справка 1]

Есть идеи?

ОБНОВЛЕНИЕ

Я пробовал добавить это, но это не имеет значения:

        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <url>https://repo.maven.apache.org/maven2</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
            </pluginRepository>

Также:

    <dependency>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>maven-replacer-plugin</artifactId>
        <version>1.4.1</version>
    </dependency>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...