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).
Have managed to:
(1) Import/build a multi module maven project in intellij
(2) Successfully built/run an artifact as a single jar from the project
(3) Modified maven project by writing new classes with extra depedencies (via changing project's structure and adding new maven dependencies*)
(4) Successfully built & run modified project
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))
What am I missing?
*note: havent touched any poms till now. 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. (Add maven dependency... will do)
To fix your maven project, you need to edit the pom.xml by hand to add the new libraries. (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).
上一篇: 多重弹簧启动配置