小编Jay*_*Jay的帖子

如何在Play 2.3中更改.activator .sbt .ivy文件夹的位置?

我刚开始学习Play Framework 2.3.0并试图移动

  • .activator
  • .sbt
  • .ivy

文件夹中的%USERPROFILE%文件夹到C:/learning/playframework/我的Windows 7计算机上的自定义文件夹.我希望它们在重新安装操作系统时可移植/不丢失.

我修改了sbt.boot.properties并更改user.home为自定义位置并作为参数传递play.homeactivator.bat.

虽然.sbt.ivy文件夹中的自定义文件夹是最初创建,当我尝试创建一个新的应用程序HelloWorld所有这些文件夹重新获得在用户目录中创建%USERPROFILE%和所有的文件下载那里.将.activator永远不会在自定义文件夹中创建,并始终在中创建%USERPROFILE%的文件夹.

我也确保路径上没有空格.

sbt.boot.properties:

[app]
  org: com.typesafe.activator
  name: activator-launcher
  version: ${activator.version-read(activator.version)[1.2.1]}
  class: activator.ActivatorLauncher
  cross-versioned: false
  components: xsbti

[repositories]
  local
  activator-local: file://${activator.local.repository-${activator.home-${play.home}/.activator}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central
  typesafe-releases: http://repo.typesafe.com/typesafe/releases
  typesafe-ivy-releasez: http://repo.typesafe.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

[boot]
 directory: ${sbt.boot.directory-${sbt.global.base-${play.home}/.sbt}/boot/}
 properties: ${activator.boot.properties-${play.home}/.activator/version-${activator.launcher.generation-0}.properties}

[ivy]
  ivy-home: ${play.home}/.ivy2
  checksums: ${sbt.checksums-sha1,md5}
  override-build-repos: ${sbt.override.build.repos-false}
  repository-config: ${sbt.repository.config-${sbt.global.base-${play.home}/.sbt}/repositories}
Run Code Online (Sandbox Code Playgroud)

请告知配置Activator/Play Framework,例如,3个目录和存储库是在自定义目录中创建的C:/learning/playframework/.

sbt playframework typesafe-activator playframework-2.3

8
推荐指数
1
解决办法
5784
查看次数

使用kotlin-spring插件,仍然得到类没有打开错误

尽管添加了kotlin-spring插件,但我得到的课程不能是最终的,需要开放.插件的整个目的是不要手动将open关键字添加到每个类.

请指导我使用Kotling-Spring插件处理下面的代码.

的build.gradle

buildscript {
    ext.kotlin_version = "1.1.2"

    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version"
    }
}

apply plugin: "kotlin"
apply plugin: "kotlin-spring"
apply plugin: "kotlin-noarg"
apply plugin: "idea"

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    compile"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    compile "org.springframework:spring-context:4.3.8.RELEASE"
    testCompile "org.springframework:spring-test:4.3.8.RELEASE"
    testCompile "junit:junit:4.11"
}
Run Code Online (Sandbox Code Playgroud)

AppConfig.java

@Configuration
class AppConfig {

    @Bean
    fun game(): Game {
        return BaseballGame(redSox(),cubs())
    }

    @Bean
    fun redSox(): Team {
        return RedSox()
    }

    @Bean
    fun cubs(): Team {
        return Cubs()
    }
} …
Run Code Online (Sandbox Code Playgroud)

spring gradle kotlin

5
推荐指数
1
解决办法
893
查看次数