Daniel Fisher (lennybacon.com)

SOA, DATA & THE WEB

Maven Archetypes in IntelliJ

IntelliJ has the ability to use Maven as build and project system. The concept of an archetype is a predefined project or project template.

When “File | New project” is used to create a new project and “Maven” is selected the following dialog is displayed:
image
IntelliJ comes with a few archetypes but of course custom ones can be added. On the MVN Repository for example several archetypes for Wildfly are available: http://mvnrepository.com/artifact/org.wildfly.archetype

image

The XML snipped can be used as copy-paste-source for IntelliJ’s “Add archetype dialog”:

image

After clicking the “OK” button the newly added archetypes are available as a source for the project creation. The custom archetypes are stored in the file “C:\{username}\Daniel\.IntelliJIdea{version}\system\Maven\Indices\UserArchetypes.xml” on Windows and “~/.IntelliJIdea{version}/system/Maven/Indices/UserArchetypes.xml” on Linux.

image

Next define group and artifact identifier as well as version for the new project:

image

Select the Maven version:

image

And the project location:

image

The result is a runnable quick start for working with the Wildfly application server.

image

Comments

Write a comment