[JAVA] Add jar file obtained from Maven to IntelliJ

Introduction

Apache Maven (hereinafter Maven) is a project management tool for Java. Maven automatically fetches sources and jars from the repository according to the pom.xml specification. In short, it's a Java open source vault. I'm new to Java so I first learned about it: umbrella:

References

What is Maven http://d.hatena.ne.jp/keyword/Maven IntelliJ-like Maven settings (head family) https://www.jetbrains.com/help/idea/getting-started-with-maven.html

Rough flow

  1. Create a Project for Maven. This contains pom.xml.
  2. Add the Project created in 1 to the Project you want to apply.

that's all. it's simple. This time, I will describe how to add it to the project being created. I wonder if this can be covered even if it is not a new project ...: frowning2:

Implementation

This time, we will make Project use a very convenient open source called "Smile" that can use a lot of statistical processing. Github Smile https://github.com/haifengl/smile It's very convenient, so please give us Star: star :.

Create a Project for Maven.

File→New→Project SnapCrab_NoName_2017-6-14_23-57-10_No-00.png If you press in the order of, the above window will appear. Then press Maven in this window. So, Next ... SnapCrab_NoName_2017-6-14_23-58-51_No-00.png Then, Next ... Then ... SnapCrab_NoName_2017-6-15_0-0-48_No-00.png A window like this will appear, so let's put in any words like this. So, Next ... SnapCrab_NoName_2017-6-15_0-1-51_No-00.png Well here is also suitable. Please memorize only the location properly. And Finish !! SnapCrab_NoName_2017-6-15_0-3-56_No-00.png I am a New Window sect.

This completes 1.

Add the Maven Project created in 1 to the project you want to apply.

File→Project Structure→Module SnapCrab_NoName_2017-6-15_0-7-41_No-00.png Then click the green plus button. Then click Import Project. SnapCrab_NoName_2017-6-15_0-9-36_No-00.png

Then, a window like this will appear. Click the Maven Project you created earlier and press OK. Then ...

SnapCrab_NoName_2017-6-15_0-10-46_No-00.png

It looks like this, so please do as shown in the image above.

Next→Next→Finish→OK

Please end with. Not finished yet: tea:

Then again File→Project Structure→Libraries Click the green plus button again with. SnapCrab_NoName_2017-6-15_0-13-59_No-00.png

Then click From Maven. Finally, download the source and jar files from Maven! !! SnapCrab_NoName_2017-6-15_0-16-10_No-00.png Enter it like this. Here, enter the repository you want to obtain. It will search to some extent and will give you suggestions, so select from there and press click. If you do not see the search response ear, press the magnifying glass mark on the right to search. SnapCrab_NoName_2017-6-15_0-18-12_No-00.png SnapCrab_NoName_2017-6-15_0-18-36_No-00.png SnapCrab_NoName_2017-6-15_0-18-46_No-00.png

It's done. Press OK.

Summary

IntellJ seems to be able to search without filling in pom.xml. Of course, I think there is also a way to fill in pom.xml.

Recommended Posts

Add jar file obtained from Maven to IntelliJ
How to add local jar to maven pom.xml
How to add jar file in ScalaIDE
Add files to jar files
Add an external jar file in your IntelliJ project.
Set up Gradle multi-project in IntelliJ to build JAR file
Add Extended Attributes to the file
How to make a jar file with no dependencies in Maven
Add a time stamp to the JAR file name in Gradle
[Xcode] How to add a README.md file
Migration file to add comment to Rails table
[IntelliJ IDEA] How to automatically add final when saving a Java file
Problems when starting IntelliJ from Maven artifact
Migration from Eclipse to IntelliJ (on the way)
How to dump from database (DB) to seeds file
How to build an executable jar in Maven
IntelliJ starting from 1
[Java] [Maven] Template of pom.xml to register 3rd party jar file in local repository
How to jump from Eclipse Java to a SQL file
[Java] How to extract the file name from the path
How to debug the generated jar file in Eclipse