项目正在运行并且正在工作,但是pom.xml显示错误 [英] project is running and working but pom.xml is showing error

查看:77
本文介绍了项目正在运行并且正在工作,但是pom.xml显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个spring项目,该项目可以正常运行,但是pom.xml显示红色错误标志,如所附的图像所示. 项目层次结构的图像

I have one spring project which is running and working fine, but the pom.xml is showing a red color error sign as shown in attached image. image of project hierarchy

即使我的项目运行正常,我也无法理解为什么显示此错误. 请建议如何从项目层次结构中删除此红色标记.

I am not able to understand why it is showing this error, even my project is running and working fine. Please suggest how to remove this red tag from project hierarchy.

预先感谢

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>TAS_EMS</groupId>
<artifactId>TAS_EMS</artifactId>
<version>0.0.2</version>
<packaging>jar</packaging>
<name>TAS_EMS</name>
<description>TAS_EMS</description>
<organization>
    <name>TATA POWER SED</name>
    <url>http://www.tatapowersed.com</url>
</organization>
<properties>
    <!-- Spring -->
    <spring-framework.version>4.1.6.RELEASE</spring-framework.version>
    <springboot-framework.version>1.2.3.RELEASE</springboot-framework.version>
    <!-- SqLite -->
    <sqlite.version>3.7.2</sqlite.version>
    <!-- Hibernate / JPA -->
    <hibernate.version>4.2.1.Final</hibernate.version>
    <!-- JSON -->
    <jackson.version>2.5.2</jackson.version>
    <!-- Portlet /JSON RPC -->
    <portlet.version>2.0</portlet.version>
    <!--HTTP / JSONRPC -->
    <commons-codec.version>1.9</commons-codec.version>
    <httpcore.version>4.3.3</httpcore.version>
    <!-- REST XML Mapping -->
    <jaxb.version>2.2.12</jaxb.version>

</properties>

<dependencies>

    <!-- Spring Jetty -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>${springboot-framework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jetty</artifactId>
        <version>${springboot-framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <version>${springboot-framework.version}</version>
        <scope>test</scope>
    </dependency>

    <!-- Spring JDBC -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>

    <!-- Spring -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>

    <!-- Hibernate -->

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>
    </dependency>

    <!-- Log4J -->

    <!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> 
        <version>1.7.12</version> </dependency> -->

    <!-- SQLite database JDBC -->

    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>${sqlite.version}</version>
    </dependency>

    <!-- json dependencies + -->

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
        <optional>true</optional>
    </dependency>

    <!-- | servlet\portlet dependencies + -->
    <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>${portlet.version}</version>
        <optional>true</optional>
        <scope>provided</scope>
    </dependency>



    <!-- | Rest XML Mapping + -->

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>${jaxb.version}</version>
    </dependency>

    <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> 
        <version>1.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-actuator</artifactId> <version>1.2.3.RELEASE</version> 
        </dependency> -->
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-cypher-compiler-2.1</artifactId>
        <version>2.1.5</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-solr</artifactId>
        <version>1.2.3.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>
            spring-boot-starter-data-elasticsearch
        </artifactId>
        <version>1.2.3.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-client</artifactId>
        <version>5.10.1</version>
    </dependency>
</dependencies>

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




        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>false</downloadJavadocs>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>

                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>com.tpcsed.tasems.app.service.StartApp</mainClass>
                        <classpathPrefix>dependency-jars/</classpathPrefix>
                    </manifest>
                </archive>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.5.1</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <includeScope>runtime</includeScope>
                        <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>


    </plugins>
</build>

推荐答案

在以下部分的pom.xml中添加以下行:

Add below lines in your pom.xml in section:

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-jar-plugin</artifactId>
 <version>3.1.1</version>
</plugin>

然后通过右键单击项目文件夹-> Maven->更新项目,从maven更新项目

Then update the project from maven by right click on Project folder -> Maven -> Update Project

完成!

参考: https://github.com/sarl/sarl/issues/921#issuecomment- 503858707

这篇关于项目正在运行并且正在工作,但是pom.xml显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆