Project name is different from artifact name

When I import Maven projects from my workspace, and these projects are children of the parent project, they are imported with the project name in the same way as the artifact identifier. But when I import the parent project, the project name is the same as the directory name.

Example directory structure:

project-parent (artifactId = project-application-parent) --web (artifactId = project-webapp) --core (artifactId = project-core) 

When I import all projects, my workspace looks like this:

 project-parent project-webapp project-core 

I want the parent project to be named as its artifact-id (project-application-parent). Is there any way to achieve this?

+4
source share
3 answers

One way to rename a project is to directly edit the .project file. This is an XML file located in the project folder with the underlying data of the eclipse about the project.

Just change the node (this will only affect the project name in Eclipse)

+2
source

You can set the projectNameTemplate property in the configuration maven-eclipse-plugin , as in the Documentation .

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>xy</version> <configuration> <projectNameTemplate>custom-project-name</projectNameTemplate> </configuration> </plugin> 
+3
source

When you import the maven project, click "Advanced" at the bottom of the import dialog box, and there you can select an alternative name template.

The default is [artifactId] , but you can choose, for example, [name] , which is the content of the description tag from pom.

+1
source

Source: https://habr.com/ru/post/1500318/


All Articles