简体   繁体   English

使用Intellij从修改后的Maven项目构建工件

[英]Building an artifact from a modified maven project with Intellij

i am trying to build an artifact from a modified maven project imported in intellij (v2016.2). 我正在尝试从intellij(v2016.2)中导入的经过修改的Maven项目构建工件。

Have managed to: 已设法:

(1) Import/build a multi module maven project in intellij (1)在intellij中导入/构建多模块Maven项目

(2) Successfully built/run an artifact as a single jar from the project (2)从项目中作为单个jar成功构建/运行工件

(3) Modified maven project by writing new classes with extra depedencies (via changing project's structure and adding new maven dependencies*) (3)通过编写带有额外依赖的新类(通过更改项目的结构并添加新的Maven依赖项*)来修改Maven项目

(4) Successfully built & run modified project (4)成功建立并运行修改后的项目

however, when i try to run an artifact from the modified project (and even if it contains all the dependencies in the jar), it completely ignores all the extra functionality of the modified project (runs exactly as in (2)) 但是,当我尝试从修改后的项目中运行工件(即使它包含jar中的所有依赖项)时,它完全忽略了修改后的项目的所有其他功能(与(2)中的运行完全一样)

What am I missing? 我想念什么?

*note: havent touched any poms till now. *注意:到目前为止尚未接触过任何pom。 All the dependencies added using File>Project Structure>Modules>Dependencies>add Library ... 使用文件>项目结构>模块>依赖关系>添加库添加的所有依赖关系...

If you don't see any change when running the project it's because you run the the previous build. 如果您在运行项目时没有看到任何更改,那是因为您运行的是先前的版本。

"Add Library" won't update your pom.xml. “添加库”不会更新您的pom.xml。 ( Add maven dependency... will do) 添加Maven依赖项...就可以了)

To fix your maven project, you need to edit the pom.xml by hand to add the new libraries. 要修复您的Maven项目,您需要手工编辑pom.xml以添加新的库。 (section dependencies ) Once it's done run mvn clean build from command line or from the maven project window (on the right edge of IntelliJ window). (部分依赖 )完成后,从命令行或maven项目窗口(在IntelliJ窗口的右侧)运行mvn clean build

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

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