Let’s say created I created a project in the Intellij idea environment. After some time I decided that I want to use Maven OM through the development environment so, as if I did creating a Maven project. Are there any ways to connect to the Maven
Answer 1, Authority 100%
To collect the Maven ‘Ohm, you need to add the necessary pom.xml files, well, and the project structure, it is desirable to bring to Maven ‘ .
For example, let your code lies in the My-Project folder. Create POM.XML At the root of this folder:
& lt; project xmlns = "http://maven.apache.org/pom/4.0.0" XMLNS: xsi = "http://www.w3.org/2001/xmlschema-instance" xsi: schemalocation = "http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd /Maven-4.0.0.xsd"&gT;
& lt; Modelversion & GT; 4.0.0 & lt; / Modelversion & GT;
& lt; groupid & gt; foo.bar & lt; / groupid & gt;
& lt; artifactid & gt; my-project & lt; / artifactid & gt;
& lt; Name & gt; My Fancy Project & Lt; / Name & GT;
& lt; version & gt; 0.0.1 & lt; / version & gt;
& lt; Dependencies & gt;
& lt;! - Here you specify all the necessary dependencies - & gt;
& lt; / dependencies & gt;
& lt; / Project & gt;
Edit the project structure:
- java code throw in
my-project / src / main / java - Resources in
My-Project / SRC / MAIN / Resources - test code in
My-Project / src / test / java
etc
If Maven-plugin is already standing, open the Maven Projects tab and add a project by specifying the path.
Answer 2, Authority 50%
To add a dependency from Maven Repository, you need:
- Go to Settings kbd>- & GT; Plugins kbd>and install everything related to
Maven - ctrl kbd>+ shift kbd>+ alt kbd>+ s kbd>find
modulesleft and Click on thedependenciestab Library ... kbd>- & gt; from maven kbd>