java <some_project> 的 POM 丢失,没有可用的依赖信息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31352413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The POM for <some_project> is missing, no dependency information available
提问by daydreamer
What I am doing?
我在做什么?
I have created a maven
project, where I bundle some external jars
我创建了一个maven
项目,我在其中捆绑了一些外部 jar
project/pom.xml
/bin
/safebrowsing2_2.11-0.2.5.jar
/scala-http-client_2.11-1.0.jar
The libraries safebrowsing2_2.11-0.2.5.jar
and scala-http-client_2.11-1.0.jar
are bundled because they are not available in Nexus
and are custom jars needed for legacy purposes.
库safebrowsing2_2.11-0.2.5.jar
和scala-http-client_2.11-1.0.jar
是捆绑在一起的,因为它们不可用Nexus
并且是遗留用途所需的自定义 jar。
pom.xml
uses following plugins
to bundle them up in one jar
pom.xml
使用以下plugins
将它们捆绑在一个罐子里
<plugins>
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<goals>
<goal>add-jars</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${basedir}/bin</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
When this build runs on Jenkins
it fails with following warnings
当此构建在Jenkins
其上运行时失败并显示以下警告
[WARNING] The POM for com.shn:project-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.shn:project-scala-http-client_2.11-1.0.jar:jar:1.0-SNAPSHOT is missing, no dependency information available
and error is
错误是
[ERROR] Failed to execute goal on project project-installer: Could not resolve dependencies for project com.project-installer:war:0.19.0-SNAPSHOT: The following artifacts could not be resolved: com.shn:project-external-dependencies-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT, com.shn:project-scala-http-client_2.11-1.0.jar:jar:1.0-SNAPSHOT: Could not find artifact com.shn:project-safebrowsing2_2.11-0.2.5.jar:jar:1.0-SNAPSHOT in company (http://172.62.11.24:8080/nexus/content/groups/public) -> [Help 1]
16:17:03 [ERROR]
16:17:03 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
16:17:03 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
16:17:03 [ERROR]
16:17:03 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:17:03 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Question
问题
Yes, I know that they do not have pom.xml
, but how do I let the build pass and generate artifact?
是的,我知道他们没有pom.xml
,但是我如何让构建通过并生成工件?
回答by GeroldBroser reinstates Monica
Use the install-file
goal of Maven's Install Plugin:
使用Maven 的 Install Plugin的install-file
目标:
... to install an externally created artifact into the local repository, along with its POM.
... 将外部创建的工件及其 POM 安装到本地存储库中。
Use the deploy-file
goal of Maven's Deploy Pluginto:
使用Maven 的 Deploy Plugin的deploy-file
目标来:
install the artifact in the remote repository.
在远程存储库中安装工件。
... rather than placing the artifacts in your project's directory.
... 而不是将工件放在您的项目目录中。