[英]Maven 3 - Use local repo for locally produced artifacts
Let's say I have an EAR that uses a 3rd party JAR from an online Maven repo, and a local JAR I produce myself, that needs to be pulled from my local repo. 假设我有一个EAR,它使用来自在线Maven存储库的第三方JAR,以及我自己生产的本地JAR,需要从本地存储库中提取。
If I build the EAR, it complains that it can't find the local JAR in the repo, because it's looking online. 如果我构建EAR,它会抱怨说它正在在线,因此它在存储库中找不到本地JAR。 However, that is the correct behaviour for the 3rd party JAR. 但是,这是第三方JAR的正确行为。
How do I get Maven to look locally for artifacts, AND online? 如何使Maven在本地查找工件并在线? I guess it would be best to look locally as a last resort. 我想最好是在本地将其作为最后的选择。 Is there a way to do this? 有没有办法做到这一点?
You could install the .jar file to the local repository. 您可以将.jar文件安装到本地存储库。
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
or else include the .jar as system dependency. 否则将.jar包含为系统依赖项。
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.