简体   繁体   中英

Generate a pom.xml from the .iml in IntelliJ

I want to Mavenize an existing Java project in Intellij for Git. I've created the pom.xml and the target/META-INF/MANIFEST.MF. In the project Settings all the Modules are visible and I've used Intellij to add all the Artifacts; and it's now able to generate a .jar that works.

However the dependencies are only added in the .iml file, not in the pom.xml. If I open pom.xml and hit cmd+N it only shows me 1 option (mysql-connector-java) and instead of the 20 or so dependencies I have. How do I add my dependencies to my pom.xml?

These are the dependencies in the .iml file that I want to add to the pom:

<libelement value="jar://$MODULE_DIR$/lib/log4j-api-2.7.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/log4j-core-2.7.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bluezzz-utils.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/htmlunit-2.19-OSGi.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bpjtk-v3.0.6.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-simple-1.1.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jsoup-1.9.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/hamcrest-core-1.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/junit-4.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-esls2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-esls4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-gr.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-servicenow-mhas.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-ess3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-ess7.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-ess8.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/bluezzz-commons.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/itsm-modules/itsm-maximo-jll.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-lang.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/mywatson.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/mywatson1.jar!/" />

I have decided to go another direction and just add all the .jar files to my repository. I didn't realize this was an option, and it completely solves my dependencies problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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