Intellij-idea adds maven plugin

How to add maven plugin to intellij-idea? I want to quickly create something like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>8.1.16.v20140903</version>
            <configuration>
                <stopKey>STOP</stopKey>
                <stopPort>8089</stopPort>
            </configuration>
        </plugin>
    </plugins>
</build>

      

+3


source to share


3 answers


  • Add Maven Integration Plugin in Settings-> Plugins.
  • Use File-> Import Project to select the existing POM at the project root. If you don't already have one, there are ways to create one for you.
  • Use completion type (ctrl-space) when typing in the POM to fill items as you type them.
  • When asked by IDEA if you want to import your changes, answer yes.

There are also tricks to automatically update the POM when project settings change, but I don't think they are as versatile or powerful. Using your example, IDEA can configure the IDE when it sees the JUnit plugin link, but has a more complicated time creating the plugin link after setting up the unit tests in the IDE.



In general, the power of Maven in an IDE is that it provides a declarative (non-procedural) facility for automatically configuring a large number of IDEs. This way the Maven POM forms a channel between IDEs.

+3


source


From this link: https://www.jetbrains.com/idea/help/maven.html it seems you have nothing to do: just add your code to the pom.xml of your project



In some cases the project is not maven character then right click on pom.xml and select aadd as maven pom

0


source


If you already have pom.xml in your project, right click on pom.xml and select Add as Maven Project, then IntelliJ will process your file and import your dependencies.

0


source







All Articles