java - 如何在 Eclipse 中重命名 gradle 项目?

标签 java gradle eclipse-plugin gradle-plugin gradle-eclipse

我是 gradle 的新手,正在尝试在 eclipse 中使用 gradle 插件。

使用在线项目生成器创建了一个 java gwt 项目 https://gwt-project-generator.cfapps.io/

enter image description here

它很好地导入了所有依赖项。

现在我试图将项目从 demo 重命名为 gradle-demo,但我很困惑。它每次都会自动将名称恢复为 demo。在 build.gradle 文件中,我看不到任何表明名称强制执行的信息。

有什么建议吗?

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
    }
}

apply plugin: 'gwt'
apply plugin: 'war'

// In this section you declare where to find the dependencies of your project
repositories {
    jcenter()
}

repositories { mavenCentral() }

// In this section you declare the dependencies for your production and test code
dependencies {
    providedCompile('fr.lteconsulting:angular2-gwt:1.6')
    providedCompile('com.google.dagger:dagger-gwt:2.8')
    providedCompile('org.jboss.gwt.elemento:elemento-core:0.5')
    providedCompile('com.vaadin.polymer:vaadin-gwt-polymer-elements:1.7.0.0')
    providedCompile('org.gwtbootstrap3:gwtbootstrap3:0.9.3')
    providedCompile('com.github.tdesjardins:gwt-ol3:2.9.0')
    providedCompile('com.googlecode.gwtquery:gwtquery:2.1.0')
    providedCompile('com.github.gwtreact:gwt-react:0.3.0')
    providedCompile('com.gwidgets:gwty-leaflet:0.4')
    providedCompile('com.sksamuel.jqm4gwt:jqm4gwt-remote:2.1.0')
    providedCompile('com.intendia.gwt:rxjava-gwt:1.0.14-beta1')
    testCompile('junit:junit:4.11')
    testCompile('com.google.gwt.gwtmockito:gwtmockito:1.1.6')

}

gwt {
    gwtVersion='2.8.0'

    modules 'com.ainosoft.firstGradleGwt'

    maxHeapSize = "1024M"

    superDev {
        noPrecompile=true
    }
}

它还显示 gwt 的项目配置中缺少构建器 enter image description here

最佳答案

将此添加到您的 build.gradle

apply plugin: 'eclipse'
eclipse {
    project {
        name = 'some-better-name'
    }
}

参见 EclipseProject docs

关于java - 如何在 Eclipse 中重命名 gradle 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45793275/

相关文章:

java - 属性中包含 ObjectId 的 MongoDB 文档

gradle - 在运行测试之前如何运行应用程序(gradle/kotlin/spring引导)

gradle - 为什么Gradle中的某些任务没有显示为属性?

gradle - 如何在gradle中打印当前任务名称

java - Eclipse android sdk 包无法打开 Android SDK 管理器

java - 收集Java类信息

eclipse - 如何以编程方式使用 JDT 编译器?

java - 注意 : com. google.common.cache.Striped64 动态访问声明的字段 'base'

java - 如何从testng结果中忽略@BeforeMethod和@AfterMethod?

java - Android:是否可以在另一个手指已经触摸屏幕时处理点击?