I created a Hello World here with Spring MVC to study the technology and put some client sites on a java server that I have.
Everything has worked, but some sites have a lot of css
and js
files, so I'm looking for an equal solution to the microsft bundle with asp.net mvc.
In stackoverflow in English there are a lot of people using minify-maven
I particularly found his documentation very poor, or myself that I am covered, you will know. On his site it shows the configuration to be placed in pom.xml
.
So far so good. I did all the setup, this is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MeuProjeto</groupId>
<artifactId>MeuProjeto</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceExcludes>
**/font-awesome.css,**/magnific-popup.css,**/util.js,**/vuid.min.js
</warSourceExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.4</version>
<executions>
<id>default-minify</id>
<configuration>
<cssSourceFiles>
<cssSourceFile>font-awesome.css</cssSourceFile>
<cssSourceFile>magnific-popup.css</cssSourceFile>
</cssSourceFiles>
<jsSourceFiles>
<jsSourceFile>util.js</jsSourceFile>
<jsSourceFile>vuid.min.js</jsSourceFile>
</jsSourceFiles>
<jsEngine>CLOSURE</jsEngine>
<closureCreateSourceMap>true</closureCreateSourceMap>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.2.0</version>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</project>
I downloaded the sample project from the site and copied the entire configuration to match it as much as possible.
The problem is that it is accusing error in this line of pom.xml:
<id>default-minify</id>
This error:
Description Resource Path Location Type cvc-complex-type.2.4.a: Invalid content was found starting with element 'id'. One of '{" link ": execution}' is expected. pom.xml / MyProject line 53 XML Problem
I'm trying to understand what this id would be, I do not want to remove it because in the documentation it's included in basic configuration . Does anyone know the reason for the problem?