简体   繁体   English

重命名使用Gradle构建的项目

[英]Rename project built with Gradle

I have a Java project built with Gradle that is using a package com.example.package1. 我有一个使用Gradle构建的Java项目,该项目使用了包com.example.package1。 I would like to change the package structure to com.example.package2 and name the corresponding directories accordingly. 我想将包结构更改为com.example.package2并相应地命名相应的目录。

Is there some refactor (Eclipse like) tool that can do that for me? 是否有一些重构工具(类似于Eclipse)可以为我做到这一点? Or what all files may I need to look into? 还是我需要查看所有文件? eg build.gradle, settings.gradle. 例如build.gradle,settings.gradle。

When you rename the directories in your project to fix the Gradle build, you should modify the following files where you will need to change the old directory name to the new. 在项目中重命名目录以修复Gradle构建时,应修改以下文件,在这些文件中需要将旧目录名更改为新目录。

  • .project 。项目
  • .classpath .classpath
  • build.gradle build.gradle
  • settings.gradle settings.gradle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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