gpt4 book ai didi

grails - 部署为WAR时,Grails 3中未编译的CSS更少

转载 作者:行者123 更新时间:2023-12-02 14:19:04 25 4
gpt4 key购买 nike

我在以下环境中有grails应用程序:

| Grails版本:3.0.9
| Groovy版本:2.4.5
| JVM版本:1.8.0_60

我安装了以下插件:

com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0
com.bertramlabs.plugins:少 Assets 管道:2.6.7

在我本地的开发环境中,我的文件很少被成功编译,并且一切正常。但是,当部署到生产环境时,较少的内容不会被预编译为CSS(据我所知)。

我认为本地环境很好,是由于less-asset-pipeline插件默认为less4j编译器。

我已经尝试按照以下文档对Git repos进行操作:

https://github.com/bertramdev/asset-pipeline
https://github.com/bertramdev/less-asset-pipeline

如果运行.gradelw assetCompile,我会看到 Assets 管道包括常规的css文件,但是对较少文件的引用将被忽略(或失败)。

这是gradle构建文件,并且我删除了一些条目以使查找内容丢失更加容易:

buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }

// Custom maven repo for the cloudinary plugin
// maven { url "http://dl.bintray.com/infinit/infinit-opensource" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'
}
}

plugins {
id "io.spring.dependency-management" version "0.5.2.RELEASE"
}

version "0.1"
group "mchq.admin"

apply plugin: "spring-boot"
apply plugin: "war"
apply plugin: "asset-pipeline"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"

ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}

assets {
minifyJs = true
minifyCss = true
}

repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://repo.grails.org/grails/repo" }

// Custom maven repo for the cloudinary plugin
maven { url "http://dl.bintray.com/infinit/infinit-opensource" }

maven { url "https://repo1.maven.org/maven2" }
}

dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"

compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"


compile 'org.grails.plugins:spring-security-core:3.0.0.M1'

compile "org.grails.plugins:mail:2.0.0.RC2"

runtime 'mysql:mysql-connector-java:5.1.37'

runtime "org.grails.plugins:asset-pipeline"

compile 'com.bertramlabs.plugins:less-asset-pipeline:2.6.7'


// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}

task stage() {
dependsOn clean, war
}
tasks.stage.doLast() {
delete fileTree(dir: "build/distributions")
delete fileTree(dir: "build/assetCompile")
delete fileTree(dir: "build/distributions")
delete fileTree(dir: "build/libs", exclude: "*.war")
}
war.mustRunAfter clean

奇怪的是,如果我在构建文件的Assets {}部分中添加了任何内容,则所有构建都将在终端中失败,并且会挂起。

任何确保这种较少文件预编译的指针都将受到欢迎!

谢谢

最佳答案

这是关于少插件的build.gradle的外观

buildscript {
dependencies {
classpath 'com.bertramlabs.plugins:less-asset-pipeline:2.6.7'
}
}
dependencies {
runtime 'com.bertramlabs.plugins:less-asset-pipeline:2.6.7'
}

您还应该获取最新版本的 Assets 管道

关于grails - 部署为WAR时,Grails 3中未编译的CSS更少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34133090/

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