Tomasz Waszczyk
Tomasz Waszczyk

Reputation: 3159

Change of Maven project

I have a project in Maven and the problem is that I cannot change the name of the whole project. There is pom.properties file:

#Generated by Maven Integration for Eclipse
#Thu Dec 19 14:38:08 CET 2013
version=1.0.0-BUILD-SNAPSHOT
groupId=org.springframework.samples
m2e.projectName=project-name
m2e.projectLocation=D\:\\Project-name
artifactId=Project-name

and I want to change the field projectName but I cannot :/ Anyone can tell me how to change the name of the project ?

Upvotes: 1

Views: 1258

Answers (3)

David V
David V

Reputation: 11699

If you have your project setup correctly, you only check-in your Maven pom file. You don't check-in IDE files (Eclipse, IntelliJ, etc.). In this case, the Maven names are the authoritative version. You can rename them in Maven, and if Eclipse keeps the old name, it should not be an issue.

Remember, that in Maven you have two concepts for name. There is artifactId which is the output name and is used for dependency resolution. There there is name, which is a human-readable name.

Just change your pom file:

<artifactId>project-name</artifactId>
<name>Friendly Project Name</name>

Upvotes: 0

user2810910
user2810910

Reputation: 287

You can always create a new project from scratch with the new name, recreate the folder/package structure, and copy the file contents of the old project into it. This works best if the project isn't too large.

Upvotes: 0

Michael Ford
Michael Ford

Reputation: 861

You will want to make a modification to the project pom.xml file.

Upvotes: 1

Related Questions