从Classpath导入较少文件Bootstrap Webjars

问题描述

我想通过Lesscss-gradle-pluginhttps://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 (将#修改为@)