如何解决从Classpath导入较少文件Bootstrap Webjars
我想通过LessCss-Gradle-Plugin(https://github.com/obecker/gradle-lesscss-plugin)从Less-Files生成CSS文件。
在我的build.gradle中,我为引导程序等添加了webjar依赖项。
dependencies {
implementation project(':pet-clinic-data')
implementation 'org.springframework.boot:spring-boot-starter-actuator:2.3.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.3.2.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web:2.3.2.RELEASE'
implementation 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
implementation 'org.webjars:webjars-locator-core:0.45'
implementation 'org.webjars:jquery:2.2.4'
implementation 'org.webjars:jquery-ui:1.11.4'
implementation 'org.webjars:bootstrap:3.3.6'
runtimeOnly 'org.springframework.boot:spring-boot-devtools:2.3.2.RELEASE'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.3.2.RELEASE'
compile group: 'org.springframework',name: 'spring-tx',version: '5.2.8.RELEASE'
}
还有我的lesscss任务:
lesscss {
source = fileTree('src/main/less') {
include '**/*.less'
}
dest = "$buildDir/resources/main/static/resources/css"
dependencies {
compile 'org.webjars:bootstrap:3.3.6'
compileClasspath 'org.webjars:bootstrap:3.3.6'
}
}
我有一些较少的文件,它们需要bootstrap-webjar中的类中的Elements(例如:label-success)。我的外部依赖项中包含webjar,但是如何使用@ Import-Statement链接到该接口? 我尝试过类似的事情:
@import "classpath: resources/webjars/bootstrap/3.3.6/less/bootstrap.less";
@import "classpath:META-
INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。