eclipse maven外部jar无法编译

时间:2015-12-02 01:17:15

标签: eclipse maven

即使在将外部jar添加到eclipse之后,Maven编译也会失败。我的Eclipse代码可以使用外部jar,但是当我编译Maven抱怨包找不到时,我有近50个外部包。

我将使用mvn依赖项稍后添加jar。

然而它应该有用,但不是运气。 任何疑难解答/建议请。

1 个答案:

答案 0 :(得分:0)

我认为如果Maven Project中没有<dependencies>标记(无论是从eclipse还是从命令行运行),都无法使用pom.xml。对于依赖于来自50个外部罐子的类的项目也是如此。 如果您不希望maven查找这些广告,则必须在pom.xml system scope添加以下条目:

<dependencies>
 <dependency>
  <groupId>selenium-server-standalone</groupId>
  <artifactId>selenium-server-standalone</artifactId>
  <version>2.46.0</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/lib/selenium-server-standalone-2.46.0.jar</systemPath>
</dependency>
</dependencies> 

有了这个,groupID&amp; artifactID没有意义。你可以编写50个<dependency>标签来引用你的50个外部罐子。

相关问题