Intellij无法找到用于运行Springboot应用程序的Jar

时间:2019-10-11 13:04:09

标签: java maven spring-boot intellij-idea

我正在从Intellij运行我的spring boot应用程序,但是在运行应用程序时出现以下错误。

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method zipkin2.Endpoint$Builder.port(I)Lzipkin2/Endpoint$Builder; but it does not exist. Its class, zipkin2.Endpoint$Builder, is available from the following locations:

    jar:file:/home/alpesh/.m2/repository/io/zipkin/zipkin2/zipkin/2.7.1/zipkin-2.7.1.jar!/zipkin2/Endpoint$Builder.class

It was loaded from the following location:

    file:/home/alpesh/.m2/repository/io/zipkin/zipkin2/zipkin/2.7.1/zipkin-2.7.1.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of zipkin2.Endpoint$Builder

我尝试在命令提示符下运行相同的命令,但收到相同的错误,然后尝试从.m2目录的zipkin2.jar中删除,然后从命令行运行应用程序,但仍然无法从Intellij运行

有人可以帮我弄清楚这个问题。

我的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>

    <name>search-service</name>
    <description>Index Search Service</description>
    <artifactId>search-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <parent>
        <groupId>com.demo</groupId>
        <artifactId>search</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>

    <properties>
        <core.version>0.0.1-SNAPSHOT</core.version>
        <demo.core.version>0.0.1-SNAPSHOT</demo.core.version>
        <search.core.version>0.0.1-SNAPSHOT</search.core.version>
        <search.client.version>0.0.1-SNAPSHOT</search.client.version>
        <mapstruct.version>1.3.0.Final</mapstruct.version>
        <power-mockito-version>1.7.4</power-mockito-version>
        <entity.share.version>0.0.1-SNAPSHOT</entity.share.version>
        <entity.version>0.0.1-SNAPSHOT</entity.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>search-client</artifactId>
            <version>${search.client.version}</version>
        </dependency>       
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>search-core</artifactId>
            <version>${search.core.version}</version>
        </dependency>
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>core</artifactId>
            <version>${core.version}</version>
        </dependency>
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>entity-core</artifactId>
            <version>${demo.core.version}</version>
        </dependency>
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>entity-share</artifactId>
            <version>${entity.share.version}</version>
        </dependency>
        <dependency>
            <groupId>com.demo</groupId>
            <artifactId>entity-client</artifactId>
            <version>${entity.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.zonky.test</groupId>
            <artifactId>embedded-database-spring-test</artifactId>
            <version>1.4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>6.6.0</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>6.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.modelmapper</groupId>
            <artifactId>modelmapper</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${power-mockito-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>${power-mockito-version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

谢谢 Alpesh

0 个答案:

没有答案