简体   繁体   English

Eclipse Maven构建包

[英]Eclipse Maven build package

I have a java project that is being built with Maven. 我有一个用Maven构建的Java项目。 Instead of generating the packages from the command line with "mvn package", I would like to generate them from Eclipse. 我不是从命令行使用“ mvn package”生成软件包,而是从Eclipse生成它们。 Looking at the Project->Properties->Maven->Life Cycle mappings, I see that plugin execution for "war:war" within the lifecyle phase "package" is "ignored" and the source is "uninteresting". 查看Project-> Properties-> Maven-> Life Cycle映射,我发现生命周期阶段“ package”中“ war:war”的插件执行被“忽略”,而源代码则“无趣”。 Where is this data maintained? 这些数据保存在哪里? How do I change it? 我该如何更改? I tried the obvious, double or right clicking on this war:war and package nodes in Eclipse. 我尝试在Eclipse中明显,双击或右键单击war:war和package节点。

I see lifecycle-mapping-metadata.xml. 我看到了lifecycle-mapping-metadata.xml。 But, I see no mention of package or war in here. 但是,我在这里没有提到打包或战争。

Any help is appreciated. 任何帮助表示赞赏。

Thanks, Scott 谢谢,斯科特

Right-click the project in Eclipse, Run As... , Maven Package (or Maven Build... and then specify the package goal). 右键单击Eclipse中的项目, 运行方式...Maven软件包 (或Maven Build ... ,然后指定软件包目标)。 That will perform the same operation right in Eclipse, using its embedded Maven runtime. 这将使用其嵌入式Maven运行时在Eclipse中执行相同的操作。

You need to create a Maven Run Configuration (assuming you have the eclipse maven plugin installed eg m2e) and define the goals you want to run from there. 您需要创建一个Maven运行配置(假设您已安装了Eclipse Maven插件,例如m2e)并定义了要从那里运行的目标。 Once done, this configuration will be available to use as it will now be part of your workspace metadata. 完成后,将可以使用此配置,因为它现在已成为工作空间元数据的一部分。

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

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