You can also select the local repository that is located in the. The internal Maven catalog is a default one. JDK: specify project's SDK (JDK) or use the default one.Ĭatalog: specify which Maven repository you want to use in your project. Location: specify the location of your project. ![]() Using options on the right, configure your project: Select Maven Archetype from the options on the left. Otherwise, select File | New | Project from the main menu. If no project is currently opened in IntelliJ IDEA, click New Project on the welcome screen. The version of Java specified in the pom.xml file overrides the version specified in the JDK for Importer option, located in the Maven settings.Ĭreate a new project with Maven archetype IntelliJ IDEA creates a Maven project with the pom.xml file that includes compiler and target versions of Java, dedicated Maven tool window, and all the necessary dependencies to start your work. In Advanced Settings, specify the following Maven coordinates that are added to the pom.xml file:įor more information on Maven coordinates, see Maven naming conventions. The selected Add sample code option will create a file with a basic code sample. Specify project's SDK (JDK) or use the default one. Select Maven in the list of Build system. Click if you want to add other languages available via plugins. Select a language that you want to use in your project. You will be able to do it later at any time. Select the Create Git repository to place the new project under version control. Name the new project and change its location if necessary. If no project is currently open in IntelliJ IDEA, click New Project on the Welcome screen. If you want to use a custom Maven version that is not bundled with IntelliJ IDEA, you need to install it locally. For more information, refer to the WSL section. You can also create a Maven project and store it in the WSL environment or open it from the WSL file system. You can easily create a new Maven project, open and sync an existing one, add a Maven support to any existing IntelliJ IDEA project, configure and manage a multi-module project. For example, package executes jar:jar if the project type is a JAR, and war:war if the project type is - you guessed it - a WAR.Īn interesting thing to note is that phases and goals may be executed in sequence.IntelliJ IDEA supports a fully-functional integration with Maven that helps you automate your building process. The specific goals executed per phase is dependant upon the packaging type of the project. Phases are actually mapped to underlying goals. site: generates site documentation for this project.clean: cleans up artifacts created by prior builds.There are two other Maven lifecycles of note beyond the default list above. deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.install: install the package into the local repository, for use as a dependency in other projects locally.verify: run any checks to verify the package is valid and meets quality criteria. ![]() integration-test: process and deploy the package if necessary into an environment where integration tests can be run.package: take the compiled code and package it in its distributable format, such as a JAR.These tests should not require the code be packaged or deployed test: test the compiled source code using a suitable unit testing framework. ![]() compile: compile the source code of the project.validate: validate the project is correct and all necessary information is available.Running Maven Tools Maven PhasesĪlthough hardly a comprehensive list, these are the most common default lifecycle phases executed. To learn more about javac's -release option, see JEP 247. For example the jboss-maven-plugin, whose purpose is "deal with various jboss items". Suffice it to say for now that a plugin is a collection of goals with a general common purpose. This archetype:generate goal created a simple project based upon a maven-archetype-quickstart archetype. If you are familiar with Ant, you may conceive of this as similar to a task. The prefix archetype is the plugin that provides the goal. You executed the Maven goal archetype:generate, and passed in various parameters to that goal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |