Use wro4j instead of lesscss plugin

It's better maintained and it seems to provide more features
as well.
This commit is contained in:
Dave Syer 2016-11-17 10:51:33 +00:00
parent e20b96a4c2
commit 131a588e09
4 changed files with 30 additions and 68 deletions

86
pom.xml
View file

@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples</groupId> <groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic</artifactId> <artifactId>springboot-petclinic</artifactId>
<version>1.4.1</version> <version>1.4.2</version>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
<name>petclinic</name> <name>petclinic</name>
@ -25,6 +25,7 @@
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version> <webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version> <webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
<webjars-jquery.version>2.2.4</webjars-jquery.version> <webjars-jquery.version>2.2.4</webjars-jquery.version>
<wro4j.version>1.8.0</wro4j.version>
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version> <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version> <thymeleaf-layout-dialect.version>2.0.4</thymeleaf-layout-dialect.version>
@ -169,78 +170,31 @@
</plugin> </plugin>
<plugin> <plugin>
<!-- right now lesscss maven plugin does NOT support @Import from <groupId>ro.isdc.wro4j</groupId>
classpath https://github.com/marceloverdijk/lesscss-maven-plugin/issues/72 <artifactId>wro4j-maven-plugin</artifactId>
workaround here will be unpacking the bootstrap on-the-fly remove this plugin <version>${wro4j.version}</version>
config when the issue is resolved OR a better resolution is found -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>unpack</id> <phase>generate-resources</phase>
<phase>process-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>run</goal>
</goals> </goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/target/less
</outputDirectory>
<includes>**/*.less</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/less</outputDirectory>
<resources>
<resource>
<directory>src/main/less</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.7.0.1.1</version>
<configuration> <configuration>
<sourceDirectory>${project.build.directory}/less</sourceDirectory> <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<outputDirectory>${project.build.directory}/classes/static/resources/css</outputDirectory> <cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
<compress>true</compress> <wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
<includes> <extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
<include>petclinic.less</include> <contextFolder>${basedir}/src/main/less</contextFolder>
</includes>
</configuration> </configuration>
<executions> <dependencies>
<execution> <dependency>
<phase>process-resources</phase> <groupId>org.webjars</groupId>
<goals> <artifactId>bootstrap</artifactId>
<goal>compile</goal> <version>${webjars-bootstrap.version}</version>
</goals> </dependency>
</execution> </dependencies>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View file

@ -11,8 +11,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
@import "META-INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less";
@icon-font-path: "../../webjars/bootstrap/fonts/"; @icon-font-path: "../../webjars/bootstrap/fonts/";
@spring-green: #6db33f; @spring-green: #6db33f;

View file

@ -0,0 +1,4 @@
#List of preProcessors
preProcessors=lessCssImport
#List of postProcessors
postProcessors=less4j

6
src/main/wro/wro.xml Normal file
View file

@ -0,0 +1,6 @@
<groups xmlns="http://www.isdc.ro/wro">
<group name="petclinic">
<css>classpath:META-INF/resources/webjars/bootstrap/3.3.6/less/bootstrap.less</css>
<css>/petclinic.less</css>
</group>
</groups>