I have a Gradle-root-project that I would like to rename (I'm using Netbeans 8.0.2) and I can't find an option to do so. With a Java project it was as simple as right click project -> rename.
Is there a way to rename a Gradle project? (Without causing issues with the classes therein)
build.gradle
file and you can change project file name to be name = 'newName'
settings.gradle
and change rootProject.name as rootProject.name = 'NewName'
$ gradle -r | grep name
$ gradle -r | grep name
My settings.gradle
had only one line and the build.gradle
didn't have a name
parameter, so this is what I did:
rootProject.name = 'NewName'
in settings.gradle
public class NewName
. Changed to the new name, the manifest attributes and mainClass values in build.gradle
:
manifest { attributes 'Main-Class': 'com.abc.NewName' }
and
if (!hasProperty('mainClass')) {
ext.mainClass = 'com.abc.NewName'
}
edit settings.gradle file:
rootProject.name = 'newNameHere'
then right click ( on the project gradle icon ) > Reload Project
NOTE: if you have errors in your config or files name wont be changed
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.