简体   繁体   中英

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 ?

您将需要对项目pom.xml文件进行修改。

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM