After copying the project in Eclipse, how to change the name of the project and other related configuration? (October 17, 2019)

Reference: https://www.cnblogs.com/momoweiduan/p/8025048.html

 

At work, we occasionally need to create a new project, but do not need to build their own framework of the project, but can be copied directly on a project. After copying, change the project name after the discovery, access paths, such as the name and packaging will keep the old name of the project, looks very unhappy, then we need to completely re-renovation project.

The first part : Right-click the project -> Properties -> Web Project Settings

  Changing Context root, change to the new project name

 

 

The second part : Eclipse, click Window -> Show view -> Navigator , get a new view mode; then click on the project under .setting file, select the file to open org.eclipse.wst.common.component

Modify the name of one of the old project, a total of three:

<wb-module deploy-name="第一处"> ; <property name="context-root" value="第二处"/> ;<property name="java-output-path" value="/第三处/target/classes"/>

 

the third part:

Open the pom.xml file for the project, which modify the 300

At first: <artifactId>; second at: <name>; third place: <finalName>. This three respectively at the beginning and end of the file not far away.

This completely revised better.

 

第四部分:这一部分可以更改项目的访问地址以及端口号

1.端口号:将项目加入tomcat中后,双击 tomcat ,在Overview视图,Ports中的 HTTP/1.1 的Port number就是访问端口号

2.访问地址:切换到Modules视图,选中 Web Modules中的一行,然后点击“Edit......”,将Path改成新的项目名

 
标签:  eclipse

参考:https://www.cnblogs.com/momoweiduan/p/8025048.html

 

在工作中,我们偶尔需要建立新的项目,但是不需要自己搭建项目框架,而是直接可以复制上一个项目。复制之后,发现改了项目名字之后,访问路径,以及打包名字等都会保留旧的项目名,看起来非常不爽,那么就需要我们彻底地将项目进行重新翻新。

第一部分:右击项目 ->Properties  ->Web Project Settings

  更改Context root,更改为新的项目名

 

 

第二部分:点击 Eclipse中  Window ->Show view ->Navigator,得到新的视图模式;然后点击项目下的 .setting 文件,选择打开 org.eclipse.wst.common.component 文件

修改其中的旧项目名,一共三处:

<wb-module deploy-name="第一处"> ; <property name="context-root" value="第二处"/> ;<property name="java-output-path" value="/第三处/target/classes"/>

 

第三部分:

打开项目的pom.xml文件,修改其中的三处

第一处:<artifactId>  ;第二处:<name> ;第三处:<finalName>。这三处分别在文件的开头 和 结尾 不远的地方。

这样就完全修改好了。

 

第四部分:这一部分可以更改项目的访问地址以及端口号

1.端口号:将项目加入tomcat中后,双击 tomcat ,在Overview视图,Ports中的 HTTP/1.1 的Port number就是访问端口号

2.访问地址:切换到Modules视图,选中 Web Modules中的一行,然后点击“Edit......”,将Path改成新的项目名

Guess you like

Origin www.cnblogs.com/cxqbk/p/11692491.html