在Maven中成功构建仍然在Eclipse中显示错误 [英] Successful build in Maven still showing errors in Eclipse

查看:108
本文介绍了在Maven中成功构建仍然在Eclipse中显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一些非常特别的东西,当我输入mvn clean install时,我的构建在maven中成功,但是一旦导入到Eclipse中就会显示错误。



看看你自己:







我想从`pom.xml中排除石英解决了问题,但我想知道为什么。






PS:如果你想看到,这里是 pom.xml

 < project xmlns =http://maven.apache.org/POM/4.0.0xmlns: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> com.thongvan.mpclient< / groupId>
< artifactId> MyClient< / artifactId>
< version> 1.0-SNAPSHOT< / version>
< packaging> jar< / packaging>

< name> MyClient< / name>
< url> http://maven.apache.org< / url>

< properties>
< project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
< / properties>

<依赖关系>
<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 3.8.1< / version>
< scope> test< / scope>
< / dependency>
<依赖关系>
< groupId> com.thongvan.mp< / groupId>
< artifactId> MyEjb< / artifactId>
< version> 1.0-SNAPSHOT< / version>
< / dependency>
<依赖关系>
< groupId> org.jboss.jbossas< / groupId>
< artifactId> jboss-as-client< / artifactId>
< version> 5.1.0.GA< / version>
< type> pom< / type>
< / dependency>
< / dependencies>
< / project>



编辑



正如你可以看到石英在这里:

解决方案

有时我也会遇到这些类型的问题。



一般来说, Maven:




  • 使用最新的m2e Eclipse插件

  • 使用Maven 3

  • 确保m2e使用与您在命令行中使用的Maven版本相同的Maven版本(而不是内部版本)

  • 将项目导入为Maven项目以生成Eclipse项目文件


I'm having something quite peculiar here, my build is successful in maven when I type "mvn clean install" however once imported into Eclipse it's showing errors.

See for yourself:

I guess exluding quartz from the `pom.xml solved the problem but I'd like to know why.


PS: Here is the pom.xml in case you want to see it:

<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>com.thongvan.mpclient</groupId>
  <artifactId>MyClient</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>MyClient</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.thongvan.mp</groupId>
        <artifactId>MyEjb</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.jbossas</groupId>
        <artifactId>jboss-as-client</artifactId>
        <version>5.1.0.GA</version>
        <type>pom</type>
    </dependency>
  </dependencies>
</project>

EDIT

As you can see quartz is here:

解决方案

Sometimes I get these types of issues as well.

Generally, what worked best for me with Eclipse & Maven:

  • Use the latest m2e Eclipse plugin
  • Use Maven 3
  • Make sure m2e uses the same Maven version as the one you're using on the command line (not the internal one)
  • Import projects as Maven projects to generate the Eclipse project files

这篇关于在Maven中成功构建仍然在Eclipse中显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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