简体   繁体   English

在`WEB-INF / lib`文件夹中找不到jar文件的解决方案,也没有在`src / main / resources`文件夹中找到?

[英]Solution for a jar file not findable in the `WEB-INF/lib` folder nor `src/main/resources` folder?

I have a Java application running on Jetty/App Engine/Spring. 我有一个在Jetty / App Engine / Spring上运行的Java应用程序。

After removing some jar files from the pom and putting them in the WEB-INF/lib folder, they are no longer findable - I get numerous "Cannot find symbol" build errors. pom删除一些jar文件并将它们放入WEB-INF/lib文件夹后,它们不再可见 - 我收到了大量的"Cannot find symbol"构建错误。

I also tried putting the jars in the src/main/resources folder - but the same outcome. 我也尝试将jar放在src/main/resources文件夹中 - 但结果相同。

How can I make these jars findable without referencing them in the pom ? 我怎样才能让没有在引用它们的这些罐子容易找到pom

UPDATE FOR PASCAL'S QUESTION: 帕萨卡问题的最新消息:

Here are the "unable fo find resource" messages I was receiving: 以下是我收到的“无法查找资源”消息:

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)

They are all related to htmlunit version 2.8 rather than the gdata library I said earlier had caused the errors. 它们都与htmlunit版本2.8相关,而不是我之前说过导致错误的gdata库。

These are the corresponding htmlunit entries in the pom file for the project I am trying to build: 这些是我正在尝试构建的项目的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>

As you correctly guessed, the htmlunit that is in my local maven repository does not have pom files. 正如您所猜测的那样,我本地maven存储库中的htmlunit没有pom文件。 I also can't remember how I installed it. 我也记不起我是如何安装它的。 In each subdirectory containing a jar file there no pom file - but instead a file called, for example, htmlunit-2.8.pom.lastUpdated which contains this text: 在包含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

You may be asking why I am using version 2.8 - well, it contains some patches that are essential for my project. 您可能会问我为什么使用2.8版本 - 嗯,它包含一些对我的项目至关重要的补丁。 Version 2.7 builds fine from the maven dependency: 版本2.7从maven依赖构建良好:

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

but when I use this: 但是当我使用它时:

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

I get an error during the build that says "command line too long": 在构建期间出现“命令行太长”时出错:

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.

As I mentioned in a comment below, I want to remove them from the pom because even though they are in my local Maven repository, while maven is building the project it always says it is trying to download each of these local dependencies, adding extra time onto each build cycle. 正如我在下面的评论中提到的,我想将它们从pom中删除,因为即使它们在我的本地Maven存储库中,而maven正在构建项目,它总是说它正在尝试下载这些本地依赖项,增加额外的时间到每个构建周期。

You aren't showing any trace illustrating the exact problem (this usually helps) but unless your local dependencies are SNAPSHOT dependencies (and that would be a bad choice for manually installed artifacts), I don't think your description of the behavior is accurate. 您没有显示任何描述确切问题的跟踪(这通常有帮助),但除非您的本地依赖项是SNAPSHOT依赖项(对于手动安装的工件,这将是一个糟糕的选择),我不认为您对该行为的描述是准确的。

I was hoping to copy these jars to a location where they will be found by the build process but without Maven trying to download any resources each time. 我希望将这些罐子复制到可以通过构建过程找到它们的位置,但是没有Maven每次都尝试下载任何资源。

My guess is that the dependencies are just missing a .pom file, which is what Maven is trying to download. 我的猜测是,依赖项只是缺少一个.pom文件,这是Maven试图下载的。 You can tell Maven to generate this pom for you when installing a JAR in your local repository using: 使用以下命令在本地存储库中安装JAR时,可以告诉Maven为您生成此pom:

mvn install:install-file -Dfile=your-artifact-1.0.jar \
                         [-DgroupId=org.some.group] \
                         [-DartifactId=your-artifact] \
                         [-Dversion=1.0] \
                         [-Dpackaging=jar] \
                         [-DgeneratePom=true]

Regardless of how horrible it may seem, I find Maven's behavior here more horrible. 不管它看起来多么可怕,我发现Maven在这里的行为更加可怕。

Using system scope dependencies doesn't seem horrible, it is an horrible and discouraged practice and should be avoided in 99,999% of the cases. 使用system范围依赖性似乎并不可怕, 这是一种可怕的, 令人沮丧的做法 ,在99,999%的案例中应该避免。 Quoting the provided link: 引用提供的链接:

system: This dependency is required in some phase of your project's lifecycle, but is system-specific. system:在项目生命周期的某个阶段需要此依赖项,但这是系统特定的。 Use of this scope is discouraged: This is considered an "advanced" kind of feature and should only be used when you truly understand all the ramifications of its use, which can be extremely hard if not actually impossible to quantify. 不鼓励使用此范围:这被认为是一种“高级”功能,只有在您真正理解其使用的所有后果时才能使用,如果实际上无法量化则可能非常困难。 This scope by definition renders your build non-portable. 根据定义,此范围使您的构建不可移植。 It may be necessary in certain edge cases. 在某些边缘情况下可能是必要的。 The system scope includes the <systemPath> element which points to the physical location of this dependency on the local machine. 系统范围包括<systemPath>元素,该元素指向此依赖关系在本地计算机上的物理位置。 It is thus used to refer to some artifact expected to be present on the given local machine an not in a repository; 因此,它用于指代预期存在于给定本地机器上而不是存储库中的某个工件; and whose path may vary machine-to-machine. 并且其路径可能因机器而异。 The systemPath element can refer to environment variables in its path: ${JAVA_HOME} for instance. systemPath元素可以在其路径中引用环境变量:例如${JAVA_HOME}

Just use Maven the right way and you won't have problems. 只要以正确的方式使用Maven,就不会有问题。 With system scoped dependencies (why on earth people keep suggesting to abuse them?!), I predict more troubles later. 有了system范围的依赖关系(为什么人们一直建议滥用它们?!),我预测会有更多的麻烦。


As you correctly guessed, the htmlunit that is in my local maven repository does not have pom files. 正如您所猜测的那样,我本地maven存储库中的htmlunit没有pom文件。 I also can't remember how I installed it. 我也记不起我是如何安装它的。

So I'm not crazy :) Obviously, my suggestion is to fix the problem and to provide the missing .pom files. 所以我并不疯狂:)显然,我的建议是解决问题并提供丢失的.pom文件。 If you don't want to reinstall the artifacts (so that Maven could generate them), you can create the .pom manually. 如果您不想重新安装工件(以便Maven可以生成它们),您可以手动创建.pom A simple file like this would suffice: 像这样的简单文件就足够了:

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

But please, don't switch to system scoped dependencies, this will do more harm than good on the long run. 但请不要切换到system范围的依赖关系,从长远来看,这将弊大于利。

You may be asking why I am using version 2.8 - well, it contains some patches that are essential for my project. 您可能会问我为什么使用2.8版本 - 嗯,它包含一些对我的项目至关重要的补丁。

You certainly have good reasons and I won't even discuss them. 你当然有充分的理由,我甚至不会讨论它们。

(...) I get an error during the build that says "command line too long": (...)我在构建过程中遇到“命令行太长”的错误:

That's unfortunate, and you should report this problem to datanucleus. 这很不幸,你应该把这个问题报告给datanucleus。

<dependency>
    <groupId>org.companyname</groupId>
    <artifactId>artifact</artifactId>
    <version>versionNumber</version>
    <scope>system</scope>
    <systemPath>PATH_TO_YOUR_JAR</systemPath>
</dependency>

Try something like this 尝试这样的事情

Dependencies with the scope system are always available and are not looked up in repository. 范围系统的依赖关系始终可用,并且不会在存储库中查找。 They are usually used to tell Maven about dependencies which are provided by the JDK or the VM. 它们通常用于告诉Maven有关JDK或VM提供的依赖关系。 Thus, system dependencies are especially useful for resolving dependencies on artifacts which are now provided by the JDK, but where available as separate downloads earlier. 因此,系统依赖性对于解决现在由JDK提供的工件的依赖性特别有用,但是可以在之前单独下载。 Typical example are the JDBC standard extensions or the Java Authentication and Authorization Service (JAAS). 典型示例是JDBC标准扩展或Java身份验证和授权服务(JAAS)。

A simple example would be: 一个简单的例子是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM