gpt4 book ai didi

backbone.js - Spring Boot Gradle插件bootRun任务无法识别Yeoman生成的静态文件并使用grunt更新时

转载 作者:行者123 更新时间:2023-12-03 04:06:01 25 4
gpt4 key购买 nike

我有一个由Yeoman生成的Backbone应用程序。使用Spring Boot Gradle插件和bootRun任务来运行应用程序,当我对JS源进行更改并运行Grunt将源重新编译/最小化到dist目录时,这些更改不会反射(reflect)在当前运行的bootRun任务中。

build.gradle

buildscript {
repositories {
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
mavenLocal()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:0.5.0.M7"
}
}

apply plugin: "java"
apply plugin: "idea"
apply plugin: "spring-boot"
apply plugin: "war"

war {
baseName = "mis-support-client"
version = "1.0.0-SNAPSHOT"
includes = ["dist/**"]
}

repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}

dependencies {
testCompile "junit:junit:4.11"

compile ("org.springframework.boot:spring-boot-starter-web:0.5.0.M7") {
exclude module: "spring-boot-starter-tomcat"
}
compile "org.springframework.boot:spring-boot-starter-jetty:0.5.0.M7"
compile "org.springframework.boot:spring-boot-starter-security:0.5.0.M7"
compile "org.springframework.boot:spring-boot-starter-websocket:0.5.0.M7"
compile "javax.inject:javax.inject:1"
compile "org.codehaus.jackson:jackson-mapper-asl:1.9.12"
compile "org.apache.httpcomponents:httpclient:4.3.1"
compile "commons-io:commons-io:2.4"
}

task wrapper (type: Wrapper) {
gradleVersion = "1.8"
}

这是我的客户资源处理程序,用于映射“dist”目录。
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/bower_components/**", "/scripts/**", "/styles/**", "/fonts/**", "/font/**")
.addResourceLocations("/dist/bower_components/", "/dist/scripts/", "/dist/styles/", "/dist/bower_components/bootstrap/fonts/", "/dist/bower_components/font-awesome/font/")
.setCachePeriod(315569126);
}

最佳答案

我让您的应用程序运行,并验证了可以重新加载src/main/resources提供的资源,但是直到今天为止,只有当我使用Maven时(这里是issue about that)。如果您想进一步讨论,github问题对我而言很好。

关于backbone.js - Spring Boot Gradle插件bootRun任务无法识别Yeoman生成的静态文件并使用grunt更新时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21047061/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com