【问题标题】:How to fix plugin could not be resolved error with maven-shade-plugin in Jetty?如何修复 Jetty 中的 maven-shade-plugin 无法解决插件错误?
【发布时间】:2020-08-02 23:53:34
【问题描述】:

我正在尝试使用 Jetty第一次制作 HTTP 服务器。我仍在使用POM.xml 文件并遇到mavin-shade-plugin 错误。我想我有正确的GroupIdArtifactId 用于所说的插件,我很确定我有正确的版本(1.8)。还有很多我不知道的东西。

插件标签是这样的:

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <transformers>
                        <transformer
                            implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                    </transformers>

                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.3.v20170317</version>
            </plugin>

这个错误只是Eclipse中的一个警告,并说

Description Resource    Path    Location    Type
Plugin could not be resolved. Ensure the plugin's groupId, artifactId and version are present.

Additional information: Plugin org.apache.maven.plugins:maven-shade-plugin:1.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-shade-plugin:jar:1.8 pom.xml /doecanadahttp  line 19 Language Servers

,但我感觉它会导致错误。

【问题讨论】:

  • 您可以编辑您的问题并包含您收到的警告/错误的输出吗?
  • @Joakim-Erdfelt 是的
  • 但现在不行,因为我现在没有它
  • @JoakimErdfelt 那里

标签: xml maven http jetty


【解决方案1】:

Maven 全球存储库中没有可用的 org.apache.maven.plugins:maven-shade-plugin 1.8 版。

https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-shade-plugin/

选择不同的版本(存在)。

示例(对于版本 3.2.4,确实存在):

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.2.4</version>
  ...

【讨论】:

  • 我应该下载任何东西(即maven-shade-plugin-[version]-javadoc.jarmaven-shade-plugin-[version].jar)吗?如果是这样,它应该去哪里?
  • 只需将&lt;version&gt;条目更改为存在的内容,不要直接从我发布的网址下载。
【解决方案2】:

我遇到了类似的问题。就我而言,该版本实际上在 Maven 存储库中可用。

我执行了“文件 -> 使 Cashes 无效”并重新启动 IDE,问题就消失了。

【讨论】:

    猜你喜欢
    • 2022-07-19
    • 1970-01-01
    • 2010-12-21
    • 2011-04-24
    • 2014-09-05
    • 1970-01-01
    • 2015-05-06
    • 2019-09-09
    • 1970-01-01
    相关资源
    最近更新 更多