JitPack Maven PluginResolutionException

JitPack Maven PluginResolutionException

我想用 https://github.com/NiklasHoltmeyer/maven-endpointscoverage

无需克隆:

https://jitpack.io/#NiklasHoltmeyer/maven-endpointscoverage

Pom.xml:

<project ...

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <!--
                 <groupId>de.hsos.bachelorarbeit.nh</groupId>
                  <artifactId>endpointscoverage-maven-plugin</artifactId>
                  <version>1.0.0</version>
                  -->
                <groupId>com.github.NiklasHoltmeyer</groupId>
                <artifactId>maven-endpointscoverage</artifactId>
                <version>1.0.0</version>
                ... config ..
            </plugin>
...

[ERROR] Plugin com.github.NiklasHoltmeyer:maven-endpointscoverage:1.0.0 or one of its dependencies could not be resolved: Could not find artifact com.github.NiklasHoltmeyer:maven-endpointscoverage:jar:1.0.0 in central (https://repo.maven.apache.org/maven2) -> [
Help 1]

如果我编译插件并根据 Commentblock 中的所有内容更改 groupId / artifactId 它就可以工作..

我也尝试了以下版本:

如果有人能帮助我就太好了

编辑:

新 Pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </pluginRepository>
    </pluginRepositories>

   <build>
        <plugins>
        ...
            <plugin>
                <groupId>com.github.NiklasHoltmeyer</groupId>
                <artifactId>maven-endpointscoverage</artifactId>
                <version>1.0.0</version>
                ...

mvn dependency:resolve-plugins

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.0.2:resolve-plugins (default-cli) on project vet: org.eclipse.aether.resolution.DependencyResolutionException: Failure to find com.github.NiklasHoltmeyer:maven-endpointscoverage:j
ar:1.0.0 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]

mvn clean install -U

[ERROR] Invalid plugin descriptor for com.github.NiklasHoltmeyer:maven-endpointscoverage:1.0.0 (C:\Users\nikla\.m2\repository\com\github\NiklasHoltmeyer\maven-endpointscoverage.0.0\maven-endpointscoverage-1.0.0.jar), Plugin's descriptor contains the wrong gro
up ID: de.hsos.bachelorarbeit.nh, Plugin's descriptor contains the wrong artifact ID: endpointscoverage-maven-plugin -> [Help 1]

将此添加到您的 pom:

<pluginRepositories>
    <pluginRepository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </pluginRepository>
</pluginRepositories>

因为你用的是插件。您带有 <repositories> 的代码仅包含依赖项,而不包含插件依赖项。

其余保持原样,运行mvn dependency:resolve-plugins命令解决插件依赖关系。


这是我的作品pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>Sandbox</groupId>
    <artifactId>Sandbox</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.github.NiklasHoltmeyer</groupId>
                <artifactId>maven-endpointscoverage</artifactId>
                <version>1.0.0</version>
            </plugin>
        </plugins>
    </build>
</project>