【问题标题】:Solution for a jar file not findable in the `WEB-INF/lib` folder nor `src/main/resources` folder?在 `WEB-INF/lib` 文件夹和 `src/main/resources` 文件夹中找不到 jar 文件的解决方案?
【发布时间】:2011-04-30 20:25:16
【问题描述】:

我有一个在 Jetty/App Engine/Spring 上运行的 Java 应用程序。

pom 中删除一些jar 文件并将它们放入WEB-INF/lib 文件夹后,它们不再可找到- 我收到大量"Cannot find symbol" 构建错误。

我还尝试将罐子放在 src/main/resources 文件夹中 - 但结果相同。

如何在不引用 pom 的情况下使这些 jar 可被找到?

帕斯卡问题更新:

以下是我收到的“无法找到资源”消息:

Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/htmlunit/2.8/htmlunit-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit:pom:2.8' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn/re
pository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/htmlunit/2.8/htmlunit-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit:pom:2.8' in repository jboss-repo (https://repository.jboss.org/nexus/content/groups
/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/htmlunit/2.8/htmlunit-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit:pom:2.8' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/apache-mime/0.6/apache-mime-0.6.pom
[INFO] Unable to find resource 'htmlunit:apache-mime:pom:0.6' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn
/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/apache-mime/0.6/apache-mime-0.6.pom
[INFO] Unable to find resource 'htmlunit:apache-mime:pom:0.6' in repository jboss-repo (https://repository.jboss.org/nexus/content/gro
ups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/apache-mime/0.6/apache-mime-0.6.pom
[INFO] Unable to find resource 'htmlunit:apache-mime:pom:0.6' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/commons-codec/1.4/commons-codec-1.4.pom
[INFO] Unable to find resource 'htmlunit:commons-codec:pom:1.4' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/s
vn/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/commons-codec/1.4/commons-codec-1.4.pom
[INFO] Unable to find resource 'htmlunit:commons-codec:pom:1.4' in repository jboss-repo (https://repository.jboss.org/nexus/content/g
roups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/commons-codec/1.4/commons-codec-1.4.pom
[INFO] Unable to find resource 'htmlunit:commons-codec:pom:1.4' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/commons-collections/3.2.1/commons-collections-3.2.1.pom
[INFO] Unable to find resource 'htmlunit:commons-collections:pom:3.2.1' in repository maven-gae-repo (http://maven-gae-plugin.googleco
de.com/svn/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/commons-collections/3.2.1/commons-collections-3.2.1.pom

[INFO] Unable to find resource 'htmlunit:commons-collections:pom:3.2.1' in repository jboss-repo (https://repository.jboss.org/nexus/c
ontent/groups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/commons-collections/3.2.1/commons-collections-3.2.1.pom
[INFO] Unable to find resource 'htmlunit:commons-collections:pom:3.2.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/commons-logging/1.1.1/commons-logging-1.1.1.pom
[INFO] Unable to find resource 'htmlunit:commons-logging:pom:1.1.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.c
om/svn/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/commons-logging/1.1.1/commons-logging-1.1.1.pom
[INFO] Unable to find resource 'htmlunit:commons-logging:pom:1.1.1' in repository jboss-repo (https://repository.jboss.org/nexus/conte
nt/groups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/commons-logging/1.1.1/commons-logging-1.1.1.pom
[INFO] Unable to find resource 'htmlunit:commons-logging:pom:1.1.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/cssparser/0.9.5/cssparser-0.9.5.pom
[INFO] Unable to find resource 'htmlunit:cssparser:pom:0.9.5' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn
/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/cssparser/0.9.5/cssparser-0.9.5.pom
[INFO] Unable to find resource 'htmlunit:cssparser:pom:0.9.5' in repository jboss-repo (https://repository.jboss.org/nexus/content/gro
ups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/cssparser/0.9.5/cssparser-0.9.5.pom
[INFO] Unable to find resource 'htmlunit:cssparser:pom:0.9.5' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/htmlunit-core-js/2.8/htmlunit-core-js-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit-core-js:pom:2.8' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.co
m/svn/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/htmlunit-core-js/2.8/htmlunit-core-js-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit-core-js:pom:2.8' in repository jboss-repo (https://repository.jboss.org/nexus/conten
t/groups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/htmlunit-core-js/2.8/htmlunit-core-js-2.8.pom
[INFO] Unable to find resource 'htmlunit:htmlunit-core-js:pom:2.8' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/httpclient/4.0.1/httpclient-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpclient:pom:4.0.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/sv
n/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/httpclient/4.0.1/httpclient-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpclient:pom:4.0.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/gr
oups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/httpclient/4.0.1/httpclient-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpclient:pom:4.0.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/httpcore/4.0.1/httpcore-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpcore:pom:4.0.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn/
repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/httpcore/4.0.1/httpcore-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpcore:pom:4.0.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/grou
ps/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/httpcore/4.0.1/httpcore-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpcore:pom:4.0.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/httpmime/4.0.1/httpmime-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpmime:pom:4.0.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn/
repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/httpmime/4.0.1/httpmime-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpmime:pom:4.0.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/grou
ps/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/httpmime/4.0.1/httpmime-4.0.1.pom
[INFO] Unable to find resource 'htmlunit:httpmime:pom:4.0.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/nekohtml/1.9.14/nekohtml-1.9.14.pom
[INFO] Unable to find resource 'htmlunit:nekohtml:pom:1.9.14' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn
/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/nekohtml/1.9.14/nekohtml-1.9.14.pom
[INFO] Unable to find resource 'htmlunit:nekohtml:pom:1.9.14' in repository jboss-repo (https://repository.jboss.org/nexus/content/gro
ups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/nekohtml/1.9.14/nekohtml-1.9.14.pom
[INFO] Unable to find resource 'htmlunit:nekohtml:pom:1.9.14' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/sac/1.3/sac-1.3.pom
[INFO] Unable to find resource 'htmlunit:sac:pom:1.3' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn/reposit
ory)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/sac/1.3/sac-1.3.pom
[INFO] Unable to find resource 'htmlunit:sac:pom:1.3' in repository jboss-repo (https://repository.jboss.org/nexus/content/groups/publ
ic)
Downloading: http://repo1.maven.org/maven2/htmlunit/sac/1.3/sac-1.3.pom
[INFO] Unable to find resource 'htmlunit:sac:pom:1.3' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/serializer/2.7.1/serializer-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:serializer:pom:2.7.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/sv
n/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/serializer/2.7.1/serializer-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:serializer:pom:2.7.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/gr
oups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/serializer/2.7.1/serializer-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:serializer:pom:2.7.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/xalan/2.7.1/xalan-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:xalan:pom:2.7.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn/rep
ository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/xalan/2.7.1/xalan-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:xalan:pom:2.7.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/groups/
public)
Downloading: http://repo1.maven.org/maven2/htmlunit/xalan/2.7.1/xalan-2.7.1.pom
[INFO] Unable to find resource 'htmlunit:xalan:pom:2.7.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/xercesImpl/2.9.1/xercesImpl-2.9.1.pom
[INFO] Unable to find resource 'htmlunit:xercesImpl:pom:2.9.1' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/sv
n/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/xercesImpl/2.9.1/xercesImpl-2.9.1.pom
[INFO] Unable to find resource 'htmlunit:xercesImpl:pom:2.9.1' in repository jboss-repo (https://repository.jboss.org/nexus/content/gr
oups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/xercesImpl/2.9.1/xercesImpl-2.9.1.pom
[INFO] Unable to find resource 'htmlunit:xercesImpl:pom:2.9.1' in repository central (http://repo1.maven.org/maven2)
Downloading: http://maven-gae-plugin.googlecode.com/svn/repository/htmlunit/xml-apis/1.3.04/xml-apis-1.3.04.pom
[INFO] Unable to find resource 'htmlunit:xml-apis:pom:1.3.04' in repository maven-gae-repo (http://maven-gae-plugin.googlecode.com/svn
/repository)
Downloading: https://repository.jboss.org/nexus/content/groups/public/htmlunit/xml-apis/1.3.04/xml-apis-1.3.04.pom
[INFO] Unable to find resource 'htmlunit:xml-apis:pom:1.3.04' in repository jboss-repo (https://repository.jboss.org/nexus/content/gro
ups/public)
Downloading: http://repo1.maven.org/maven2/htmlunit/xml-apis/1.3.04/xml-apis-1.3.04.pom
[INFO] Unable to find resource 'htmlunit:xml-apis:pom:1.3.04' in repository central (http://repo1.maven.org/maven2)

它们都与 htmlunit 2.8 版本有关,而不是我之前说的导致错误的 gdata 库。

这些是我正在尝试构建的项目的 pom 文件中相应的 htmlunit 条目:

    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>htmlunit</artifactId>
        <version>2.8</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>apache-mime</artifactId>
        <version>0.6</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.5</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>htmlunit-core-js</artifactId>
        <version>2.8</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>nekohtml</artifactId>
        <version>1.9.14</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>sac</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>serializer</artifactId>
        <version>2.7.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>xalan</artifactId>
        <version>2.7.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.9.1</version>
    </dependency>
    <dependency>
        <groupId>htmlunit</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.3.04</version>
    </dependency>

你猜对了,我本地 maven 存储库中的 htmlunit 没有 pom 文件。我也不记得我是如何安装它的。在每个包含 jar 文件的子目录中,没有 pom 文件 - 而是一个名为 htmlunit-2.8.pom.lastUpdated 的文件,其中包含以下文本:

#Last modified on: Tue Oct 26 13:43:29 BST 2010
#Tue Oct 26 13:43:29 BST 2010
http\://maven-gae-plugin.googlecode.com/svn/repository=1288097006231
https\://repository.jboss.org/nexus/content/groups/public=1288097009578
http\://repo1.maven.org/maven2=1288097009912

您可能会问我为什么使用 2.8 版 - 嗯,它包含一些对我的项目至关重要的补丁。 2.7 版从 maven 依赖项构建得很好:

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit</artifactId>
   <version>2.7</version>
</dependency>

但是当我使用这个时:

<dependency>
   <groupId>net.sourceforge.htmlunit</groupId>
   <artifactId>htmlunit</artifactId>
   <version>2.8</version>
</dependency>

在构建过程中出现“命令行太长”的错误:

10/26/10 9:03:27 PM BST: [ERROR]  Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
10/26/10 9:03:27 PM BST: [ERROR] --------------------
10/26/10 9:03:27 PM BST: [ERROR] The command line is too long.

【问题讨论】:

  • 具体是哪些jar文件?它可能会有所作为。
  • 你想通过从 pom 中删除 jars 来实现什么?
  • 这没有任何意义。并且使用 system 范围依赖是一种可怕的做法,完全不鼓励。
  • @Pascal:正如我在下面的评论中提到的,我想将它们从 pom 中删除,因为即使它们在我的本地 Maven 存储库中,而 maven 正在构建项目时它总是说它正在尝试下载每个本地依赖项,为每个构建周期增加额外的时间。我希望将这些 jar 复制到构建过程可以找到它们的位置,但 Maven 不会每次都尝试下载任何资源。不管看起来多么可怕,我觉得 Maven 在这里的行为更可怕。

标签: java spring jetty maven pom.xml


【解决方案1】:

正如我在下面的评论中提到的,我想从 pom 中删除它们,因为即使它们在我的本地 Maven 存储库中,当 maven 正在构建项目时,它总是说它正在尝试下载这些本地依赖项中的每一个,在每个构建周期中增加额外的时间。

您没有显示任何说明确切问题的跟踪(这通常会有所帮助),但除非您的本地依赖项是 SNAPSHOT 依赖项(这对于手动安装的工件来说是一个糟糕的选择),我不认为您对行为是准确的。

我希望将这些 jar 复制到构建过程可以找到它们的位置,但 Maven 不会每次都尝试下载任何资源。

我的猜测是依赖项只是缺少一个 .pom 文件,这是 Maven 试图下载的文件。在本地存储库中安装 JAR 时,您可以告诉 Maven 为您生成这个 pom:

mvn install:install-file -Dfile=your-artifact-1.0.jar \ [-DgroupId=org.some.group] \ [-DartifactId=你的工件] \ [-版本=1.0] \ [-Dpackaging=jar] \ [-DgeneratePom=true]

不管看起来多么可怕,我觉得 Maven 在这里的行为更可怕。

使用system 范围依赖并不似乎可怕,这是一种可怕的discouraged 做法,应该在 99,999% 的情况下避免使用。引用提供的链接:

系统: 在项目生命周期的某个阶段需要此依赖项,但它是特定于系统的。 不鼓励使用此范围:这被认为是一种“高级”功能,只有在您真正了解其使用的所有后果时才应使用,如果不是实际上无法量化,这可能会非常困难。 根据定义,此范围使您的构建不可移植。在某些边缘情况下可能是必要的。系统范围包括&lt;systemPath&gt; 元素,它指向本地机器上此依赖项的物理位置。因此,它用于指代预期会出现在给定本地机器上而不是存储库中的某些工件;并且其路径可能因机器而异。 systemPath 元素可以引用其路径中的环境变量:例如${JAVA_HOME}

只要以正确的方式使用 Maven,您就不会遇到任何问题。有了system 作用域的依赖(为什么人们总是建议滥用它们?!),我预测以后会有更多的麻烦。


正如您猜对的那样,我本地 maven 存储库中的 htmlunit 没有 pom 文件。我也不记得我是怎么安装的了。

所以我没疯:) 显然,我的建议是解决问题并提供丢失的.pom 文件。如果您不想重新安装工件(以便 Maven 生成它们),您可以手动创建 .pom。像这样一个简单的文件就足够了:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>ze.groupId</groupId>
  <artifactId>some-artifact-id</artifactId>
  <version>X.Y.Z</version>
</project>

但是请不要切换到 system 范围依赖,从长远来看,这弊大于利。

您可能会问我为什么使用 2.8 版 - 嗯,它包含一些对我的项目至关重要的补丁。

你当然有充分的理由,我什至不会讨论它们。

(...) 在构建过程中出现“命令行太长”的错误:

很不幸,您应该将此问题报告给 datanucleus。

【讨论】:

  • @Pascal:感谢您热情洋溢的回应。这就是我安装每个 gdata jar 的方式:mvn install:install-file -DgroupId=gdata -DartifactId=base -Dversion=1.0 -Dfile=gdata-base-1.0.jar -Dpackaging=jar -DgeneratePom=true。如您所见,它确实生成了 pom,我可以在检查安装目录后验证这一点。很遗憾,我目前无法为您重现原始问题,因此我理解您对没有看到原始痕迹感到沮丧。
  • @wiki 然后我的猜测是错误的。但是,如果您稍后可以发布跟踪,我会看看并更新我的答案。相信我,使用 system 范围并不是一个好的“解决方案”,我会尽力提供替代方案。
  • @Pascal:我很感激。我已经用一些额外的信息更新了这个问题。
  • @wiki 感谢您发布跟踪记录并确认我走在正确的轨道上。
  • @Pascal:我将重新安装工件,以便 Maven 可以生成 pom。感谢您的解释。
【解决方案2】:
<dependency>
    <groupId>org.companyname</groupId>
    <artifactId>artifact</artifactId>
    <version>versionNumber</version>
    <scope>system</scope>
    <systemPath>PATH_TO_YOUR_JAR</systemPath>
</dependency>

试试这样的

范围系统的依赖项始终可用,并且不会在存储库中查找。它们通常用于告诉 Maven JDK 或 VM 提供的依赖项。因此,系统依赖关系对于解决对工件的依赖关系特别有用,这些工​​件现在由 JDK 提供,但之前可以单独下载。典型的例子是 JDBC 标准扩展或 Java Authentication and Authorization Service (JAAS)。

一个简单的例子是:

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>javax.sql</groupId>
      <artifactId>jdbc-stdext</artifactId>
      <version>2.0</version>
      <scope>system</scope>
      <systemPath>${java.home}/lib/rt.jar</systemPath>
    </dependency>
  </dependencies>
  ...
</project>  

【讨论】:

  • 谢谢。但是正如我在上面的评论中对@axtavt 提到的那样,我想从 pom 中删除它们,因为即使它们在我的本地 Maven 存储库中,当 maven 正在构建项目时,它总是说它正在尝试下载这些本地依赖项中的每一个,在每个构建周期中增加额外的时间。我希望将这些 jar 复制到构建过程可以找到它们的位置,但 Maven 不会每次都尝试下载任何资源。
  • @wiki,试试这个conf。它不会下载,因为 maven 被指示从系统路径本身引用
  • @wiki 你也可以使用-o 标志来指示maven强制在离线模式下构建
  • @wiki 您使用 -o 或 conf.上面?
  • 我用-o 做到了,但我现在正在尝试另一种方式。
猜你喜欢
  • 2012-06-30
  • 2012-05-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-05
  • 2012-07-11
相关资源
最近更新 更多