java 处理 POM 时遇到了一些问题:[error] non resolvable import POM

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36149144/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 01:00:12  来源:igfitidea点击:

some problems were encountered while processing the POMs: [error] non resolvable import POM

javamavenintellij-ideajersey

提问by salamanka44

I want to start a new Jersey project but I failed in the first step because pom.xml show some errors and the project can't be built. the error :

我想开始一个新泽西项目,但我在第一步失败了,因为 pom.xml 显示一些错误并且项目无法构建。错误 :

some problems were encountered while processing the POMs:
[error] non resolvable import POM: Could not transfer artifact org.glassfish.jersey: jersey-bom:pom...."

Here is my pom.xml :

这是我的 pom.xml :

    <?xml version="1.0" encoding="UTF-8"?>
    <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>JERSEYProject</groupId>
 <artifactId>JERSEYProject</artifactId>
 <packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>simple-service-webapp</name>

<build>
    <finalName>simple-service-webapp</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <inherited>true</inherited>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>


<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey</groupId>
            <artifactId>jersey-bom</artifactId>
            <version>${jersey.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
<dependency>
    <groupId>org.glassfish.jersey.containers</groupId>
    <artifactId>jersey-container-servlet-core</artifactId>
</dependency>
</dependencies>

Can you please help me to fix this problem? I tried a lot of configurations but none of theme worked. I don't know if I had problem on my IDE configuration (IntelliJ). Thank you!!

你能帮我解决这个问题吗?我尝试了很多配置,但没有一个主题有效。我不知道我的 IDE 配置(IntelliJ)是否有问题。谢谢!!

采纳答案by Patrick

You need to specify the version of the glassfish.Either directly or as variable with the given name jersey.version

您需要指定 glassfish 的版本。直接指定或作为具有给定名称的变量 jersey.version