When I import Maven projects from my workspace and these projects are children of a parent project, they're imported with project name exactly like the artifact-id. But when I import a parent project, the project name is just like the directory name.
Example of 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
What I want is to parent project be named like his artifact-id (project-application-parent). Is there a way to achieve this?
artifactId is the name of the jar without version. If you created it, then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar, you have to take the name of the jar as it's distributed.
3.1.groupId – a unique base name of the company or group that created the project. artifactId – a unique name of the project. version – a version of the project.
The name of the groupId element has to be in lower case. Use the reverse of a domain name that can be used to uniquely identify your project. This will also help to avoid collisions between artifacts produced by different projects. Avoid using digits or special characters (that is, org.
When you import maven project, click on 'Advanced' panel on the bottom of the import dialog and there you can choose 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.
It is possible setting the projectNameTemplate
property in the configuration
of the maven-eclipse-plugin
, as in Documentation.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>x.y</version>
<configuration>
<projectNameTemplate>custom-project-name</projectNameTemplate>
</configuration>
</plugin>
One way to rename the project is directly editing the .project
file. This is a XML file located in the project folder with basic eclipse information about the project.
Just change the node (it will only affect the project name in Eclipse)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With