Twitter bootstrap 使用Twitter引导';带有wro4j maven插件的s theme.less
由于某些原因,我无法使用wro4j构建/编译Twitter bootstrap 使用Twitter引导';带有wro4j maven插件的s theme.less,twitter-bootstrap,maven,wro4j,Twitter Bootstrap,Maven,Wro4j,由于某些原因,我无法使用wro4j构建/编译主题.less(来自Bootstrap3.2.0)。我在Maven插件输出中得到了一些错误,例如: [INFO] processing group: bootstrap-theme.css 2487 ERROR Less4jProcessor - Failed to compile less resource: ro.isdc.wro.model.resource.Resource@53bb87b9[CSS,bootstrap-theme,t
主题.less
(来自Bootstrap3.2.0)。我在Maven插件输出中得到了一些错误,例如:
[INFO] processing group: bootstrap-theme.css
2487 ERROR Less4jProcessor - Failed to compile less resource: ro.isdc.wro.model.resource.Resource@53bb87b9[CSS,bootstrap-theme,true].
2487 ERROR Less4jProcessor - 2069:13 no viable alternative at input '>' in ruleset (which started at 2068:1).
2487 ERROR Less4jProcessor - 2069:25 mismatched input '@start-color' expecting '~'<escaped value>'' in selectors (which started at 2069:3).
2487 ERROR Less4jProcessor - 2069:25 no viable alternative at input '@start-color' in ruleset (which started at 2069:3).
2487 ERROR Less4jProcessor - 2069:46 no viable alternative at input '@progress-bg' in selectors (which started at 2069:37).
wro.xml
/bootstrap-3.2.0/less/bootstrap.less
/bootstrap-3.2.0/js/*.js
/bootstrap-3.2.0/less/theme.less
pom.xml
ro.isdc.wro4j
wro4j maven插件
1.7.6
ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
${basedir}/src/main/webapp/,${project.build.directory}
${project.build.outputDirectory}/${project.build.finalName}
${project.build.directory}/${project.build.finalName}/WEB-INF/resources/css
${project.build.directory}/${project.build.finalName}/WEB-INF/resources/js
编译
跑
恐怕我在这里有些不知所措。正常的
bootstrap.less
构建得很好——只是主题似乎不好。这是less4j中的一个bug,维护人员已经非常友好地修复了它。更新到新的less4j 1.8.2版本解决了以下问题:
<plugin>
<!-- Run the Web Resource Optimizer for Java (wro4j) as part of the build.
This tool minifies JS, compiles LESS CSS, etc. See https://code.google.com/p/wro4j/
and https://github.com/jbosstools/m2e-wro4j/wiki/Sample-twitter-bootstrap-project
for details. -->
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.7.6</version>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<!-- <targetGroups>bootstrap</targetGroups> -->
<!-- Search for resources in both the source and output trees, to ensure
that generated resources are also found. -->
<contextFolder>${basedir}/src/main/webapp/,${project.build.directory}</contextFolder>
<destinationFolder>${project.build.outputDirectory}/${project.build.finalName}</destinationFolder>
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/css</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/js</jsDestinationFolder>
</configuration>
<dependencies>
<dependency>
<groupId>com.github.sommeri</groupId>
<artifactId>less4j</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
ro.isdc.wro4j
wro4j maven插件
1.7.6
ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
${basedir}/src/main/webapp/,${project.build.directory}
${project.build.outputDirectory}/${project.build.finalName}
${project.build.directory}/${project.build.finalName}/WEB-INF/resources/css
${project.build.directory}/${project.build.finalName}/WEB-INF/resources/js
com.github.sommeri
less4j
1.8.2
编译
跑
wro4j-1.7.6使用旧版本的less4j。尝试将依赖项显式添加到最新的less4j版本:1.8.1。如果这不起作用,尝试隔离问题并在wro4j或less4j上报告(提交问题)。@AlexObjelean:碰撞less4j版本并不能解决问题。根据一些进一步的调查(和猜测),我继续进行,并将其作为less4j发行版打开:
<groups xmlns="http://www.isdc.ro/wro">
<!-- This file configures the Web Resource Optimizer for Java (wro4j). This
tool minifies JS, compiles LESS CSS, etc. See https://code.google.com/p/wro4j/
and https://github.com/jbosstools/m2e-wro4j/wiki/Sample-twitter-bootstrap-project
for details. -->
<group name="bootstrap">
<css>/bootstrap-3.2.0/less/bootstrap.less</css>
<js>/bootstrap-3.2.0/js/*.js</js>
</group>
<group name="bootstrap-theme">
<css>/bootstrap-3.2.0/less/theme.less</css>
</group>
</groups>
<plugin>
<!-- Run the Web Resource Optimizer for Java (wro4j) as part of the build.
This tool minifies JS, compiles LESS CSS, etc. See https://code.google.com/p/wro4j/
and https://github.com/jbosstools/m2e-wro4j/wiki/Sample-twitter-bootstrap-project
for details. -->
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.7.6</version>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<!-- <targetGroups>bootstrap</targetGroups> -->
<!-- Search for resources in both the source and output trees, to ensure
that generated resources are also found. -->
<contextFolder>${basedir}/src/main/webapp/,${project.build.directory}</contextFolder>
<destinationFolder>${project.build.outputDirectory}/${project.build.finalName}</destinationFolder>
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/css</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/js</jsDestinationFolder>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- Run the Web Resource Optimizer for Java (wro4j) as part of the build.
This tool minifies JS, compiles LESS CSS, etc. See https://code.google.com/p/wro4j/
and https://github.com/jbosstools/m2e-wro4j/wiki/Sample-twitter-bootstrap-project
for details. -->
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>1.7.6</version>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<!-- <targetGroups>bootstrap</targetGroups> -->
<!-- Search for resources in both the source and output trees, to ensure
that generated resources are also found. -->
<contextFolder>${basedir}/src/main/webapp/,${project.build.directory}</contextFolder>
<destinationFolder>${project.build.outputDirectory}/${project.build.finalName}</destinationFolder>
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/css</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/WEB-INF/resources/js</jsDestinationFolder>
</configuration>
<dependencies>
<dependency>
<groupId>com.github.sommeri</groupId>
<artifactId>less4j</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>