是否可以将< packaging> jar</packaging>在父pom文件中? [英] Is it possible to have <packaging>jar</packaging> in a parent pom file?
问题描述
我试图不要在这里用我的POM文件重新发明轮子.我有一个pom,我想将其转换为maven中的父pom.xml文件.
I am trying to not reinvent the wheel here with my POM files. I have a pom that I am trying to convert into a parent pom.xml file in maven.
该项目被设置为以下结构:
The project is setup as the following structure:
core
|
---- pom.xml
|
---- Proj A
|
---- <parent> pom.xml
|
Proj A - module 1
|
---- pom.xml
|
Proj A - module 2
|
---- pom.xml
|
---- Proj B
|
---- pom.xml
我似乎一切都设置正确,只是有些事情使我无法正常工作.我在cor pom.xml文件中定义了这个
I have everything seemingly set up correctly, except something is throwing me off. I have this defined in the cor pom.xml file:
<modelVersion>4.0.0</modelVersion>
<groupId>com.imx.core</groupId>
<artifactId>imx-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>Proj A</module>
<module>Proj B</module>
</modules>
除imx-core工件外,其他所有东西似乎都在构建,该工件已放入.m2回购中.由于打包不再是"jar",而是现在是"pom",我将如何从内核的pom文件创建jar包?
It all seems to build except the imx-core artifact, which it's putting in the .m2 repo. Since the packaging is no longer "jar" but now "pom", how would I go about creating the jar package from the core's pom file?
要做的很长的路要走(我假设)是创建一个全新的pom,它是所有其他pom中专用的父级和子级?如果可以在现有的core/pom.xml文件中完成此操作,那就更好了.还是我没有考虑正确的方法?
The long way to do it (I'm assuming) is to create a completely new pom which is a dedicated parent and child out all the other poms? If this could be done in the existing core/pom.xml file that would be better. Or am I not thinking about this the right way?
推荐答案
我不确定您在哪里出现问题,但是请注意,多模块项目(带有模块部分的POM)和父POM项目(带有模块部分的POM) pluginManagement和/或dependencyManagement部分)的包装类型应为"pom",并且不应包含任何源代码(除非像LICENSE.txt,README.txt,CHANGES.txt,程序集配置等).
I'm not sure exactly where you have the problem, but note that multi-module projects (POMs with a modules section) and parent POM projects (POMs with pluginManagement and/ or dependencyManagement sections) should have the packaging type "pom" and should not contain any source code (except things like LICENSE.txt, README.txt, CHANGES.txt, assembly configs etc.).
这篇关于是否可以将< packaging> jar</packaging>在父pom文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!