Skip to content

Commit 96b84ab

Browse files
secondsunghillert
authored andcommitted
Moving wro to build time instead of runtime
* Adding JBoss config file to run as context root * Bumping to Java 8
1 parent 002a737 commit 96b84ab

7 files changed

Lines changed: 50 additions & 115 deletions

File tree

pom.xml

Lines changed: 23 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</prerequisites>
2020

2121
<properties>
22-
<java-version>1.7</java-version>
22+
<java-version>1.8</java-version>
2323
<org.cloudfoundry-version>0.8.6</org.cloudfoundry-version>
2424
<org.springframework-version>4.1.6.RELEASE</org.springframework-version>
2525
<org.aspectj-version>1.6.9</org.aspectj-version>
@@ -38,6 +38,11 @@
3838
<finalName>devnexus</finalName>
3939
<defaultGoal>install</defaultGoal>
4040
<plugins>
41+
<plugin>
42+
<groupId>org.wildfly.plugins</groupId>
43+
<artifactId>wildfly-maven-plugin</artifactId>
44+
<version>1.0.2.Final</version>
45+
</plugin>
4146
<plugin>
4247
<groupId>org.apache.tomcat.maven</groupId>
4348
<artifactId>tomcat7-maven-plugin</artifactId>
@@ -170,6 +175,23 @@
170175
</execution>
171176
</executions>
172177
</plugin>
178+
<plugin>
179+
<groupId>ro.isdc.wro4j</groupId>
180+
<artifactId>wro4j-maven-plugin</artifactId>
181+
<version>1.7.7</version>
182+
<executions>
183+
<execution>
184+
<phase>compile</phase>
185+
<goals>
186+
<goal>run</goal>
187+
</goals>
188+
</execution>
189+
</executions>
190+
<configuration>
191+
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
192+
<destinationFolder>${basedir}/src/main/webapp/wro/</destinationFolder>
193+
</configuration>
194+
</plugin>
173195
</plugins>
174196

175197
<resources>
@@ -187,7 +209,6 @@
187209
<!-- <testResource> <directory>src/main/resources</directory> <filtering>true</filtering>
188210
</testResource> -->
189211
</testResources>
190-
191212
</build>
192213
<dependencies>
193214
<dependency>
@@ -672,57 +693,6 @@
672693
<type>jar</type>
673694
<scope>compile</scope>
674695
</dependency>
675-
<dependency>
676-
<groupId>ro.isdc.wro4j</groupId>
677-
<artifactId>wro4j-extensions</artifactId>
678-
<version>1.7.7</version>
679-
<exclusions>
680-
<exclusion>
681-
<artifactId>jruby-core</artifactId>
682-
<groupId>org.jruby</groupId>
683-
</exclusion>
684-
<exclusion>
685-
<artifactId>jruby-stdlib</artifactId>
686-
<groupId>org.jruby</groupId>
687-
</exclusion>
688-
<exclusion>
689-
<artifactId>gmaven-runtime-1.7</artifactId>
690-
<groupId>org.codehaus.gmaven.runtime</groupId>
691-
</exclusion>
692-
<exclusion>
693-
<artifactId>closure-compiler</artifactId>
694-
<groupId>com.google.javascript</groupId>
695-
</exclusion>
696-
<exclusion>
697-
<artifactId>bourbon-gem-jar</artifactId>
698-
<groupId>nz.co.edmi</groupId>
699-
</exclusion>
700-
<exclusion>
701-
<artifactId>sass-gems</artifactId>
702-
<groupId>me.n4u.sass</groupId>
703-
</exclusion>
704-
<exclusion>
705-
<artifactId>less</artifactId>
706-
<groupId>org.webjars</groupId>
707-
</exclusion>
708-
<exclusion>
709-
<artifactId>emberjs</artifactId>
710-
<groupId>org.webjars</groupId>
711-
</exclusion>
712-
<exclusion>
713-
<artifactId>handlebars</artifactId>
714-
<groupId>org.webjars</groupId>
715-
</exclusion>
716-
<exclusion>
717-
<artifactId>dojo-shrinksafe</artifactId>
718-
<groupId>com.github.lltyk</groupId>
719-
</exclusion>
720-
<exclusion>
721-
<artifactId>coffee-script</artifactId>
722-
<groupId>org.webjars</groupId>
723-
</exclusion>
724-
</exclusions>
725-
</dependency>
726696
<dependency>
727697
<groupId>com.github.sommeri</groupId>
728698
<artifactId>less4j</artifactId>
@@ -852,4 +822,3 @@
852822
</profile>
853823
</profiles>
854824
</project>
855-

src/main/java/com/devnexus/ting/web/WebAppInitializer.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ public void onStartup(ServletContext servletContext) throws ServletException {
132132
responseAddHttpHeadersFilterRegistration.setInitParameter("secondsToCache", "2592000");
133133
responseAddHttpHeadersFilterRegistration.addMappingForUrlPatterns(null, true, "*.css", "*.gif", "*.ico", "*.jpg", "*.png", "*.js");
134134

135-
FilterRegistration.Dynamic wro4jFilterRegistration = servletContext.addFilter("wro4jFilter", DelegatingFilterProxy.class);
136-
wro4jFilterRegistration.addMappingForUrlPatterns(null, true, "/wro/*");
137-
wro4jFilterRegistration.setInitParameter("targetFilterLifecycle", "true");
138-
139135
setupContext(servletContext);
140136
super.onStartup(servletContext);
141137
}

src/main/java/com/devnexus/ting/web/config/WebConfig.java

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@
6060
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
6161
import org.springframework.web.servlet.view.xml.MarshallingView;
6262

63-
import ro.isdc.wro.extensions.processor.css.Less4jProcessor;
64-
import ro.isdc.wro.extensions.processor.css.YUICssCompressorProcessor;
65-
import ro.isdc.wro.extensions.processor.js.UglifyJsProcessor;
66-
import ro.isdc.wro.http.ConfigurableWroFilter;
67-
import ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory;
68-
import ro.isdc.wro.model.WroModel;
69-
import ro.isdc.wro.model.factory.WroModelFactory;
70-
import ro.isdc.wro.model.group.Group;
71-
import ro.isdc.wro.model.resource.Resource;
72-
import ro.isdc.wro.model.resource.ResourceType;
73-
import ro.isdc.wro.model.resource.processor.factory.SimpleProcessorsFactory;
74-
import ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor;
7563

7664
import com.devnexus.ting.web.JaxbJacksonObjectMapper;
7765
import com.devnexus.ting.web.converter.StringToEvent;
@@ -291,49 +279,4 @@ public SimpleMappingExceptionResolver simpleMappingExceptionResolver() {
291279
return simpleMappingExceptionResolver;
292280
}
293281

294-
@Bean
295-
public ConfigurableWroFilter wro4jFilter() {
296-
final ConfigurableWroFilter wroFilter = new ConfigurableWroFilter();
297-
298-
wroFilter.setDebug(false);
299-
// wroFilter.setDebug(true);
300-
// wroFilter.setCacheUpdatePeriod(1);
301-
// wroFilter.setModelUpdatePeriod(1);
302-
303-
final ConfigurableWroManagerFactory wroManagerFactory = new ConfigurableWroManagerFactory();
304-
final SimpleProcessorsFactory simpleProcessorsFactory = new SimpleProcessorsFactory();
305-
306-
simpleProcessorsFactory.addPreProcessor(new CssImportPreProcessor());
307-
simpleProcessorsFactory.addPostProcessor(new Less4jProcessor());
308-
simpleProcessorsFactory.addPostProcessor(new YUICssCompressorProcessor());
309-
simpleProcessorsFactory.addPostProcessor(new UglifyJsProcessor());
310-
311-
wroManagerFactory.setProcessorsFactory(simpleProcessorsFactory);
312-
wroManagerFactory.setModelFactory(new DevNexusWroModelFactory());
313-
wroFilter.setWroManagerFactory(wroManagerFactory);
314-
return wroFilter;
315-
}
316-
317-
public class DevNexusWroModelFactory implements WroModelFactory {
318-
public WroModel create() {
319-
return new WroModel().addGroup(new Group("all")
320-
.addResource(Resource.create("classpath:less/main.less", ResourceType.CSS))
321-
.addResource(Resource.create("/assets/css/vendor/animate.css", ResourceType.CSS))
322-
.addResource(Resource.create("/assets/js/jquery1.11.1.min.js", ResourceType.JS))
323-
.addResource(Resource.create("/assets/js/jquery.modernizr.js", ResourceType.JS))
324-
.addResource(Resource.create("/assets/js/jquery.scrollTo.js", ResourceType.JS))
325-
.addResource(Resource.create("/assets/js/jquery.easing.min.js", ResourceType.JS))
326-
.addResource(Resource.create("/assets/js/jquery-plugins/jquery.succinct.js", ResourceType.JS))
327-
.addResource(Resource.create("/assets/js/bootstrap.min.js", ResourceType.JS))
328-
.addResource(Resource.create("/assets/js/d3.js", ResourceType.JS))
329-
.addResource(Resource.create("/assets/js/other/masonry.pkgd.js", ResourceType.JS))
330-
.addResource(Resource.create("/assets/js/jquery-plugins/jquery.fittext.js", ResourceType.JS))
331-
.addResource(Resource.create("/assets/js/other/scrollr.js", ResourceType.JS))
332-
.addResource(Resource.create("/assets/js/other/imagesloaded.pkgd.min.js", ResourceType.JS)));
333-
}
334-
335-
public void destroy() {
336-
//do some clean-up if required.
337-
}
338-
}
339282
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
3+
<context-root>/</context-root>
4+
</jboss-web>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
3+
<context-root>/</context-root>
4+
</jboss-web>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
preProcessors=cssImport
2+
postProcessors=less4j,yuiCssMin,uglifyJs

src/main/webapp/WEB-INF/wro.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<groups xmlns="http://www.isdc.ro/wro">
2+
<group name="all">
3+
<css>classpath:less/main.less</css>
4+
<css>/assets/css/vendor/animate.css</css>
5+
<js>/assets/js/jquery1.11.1.min.js</js>
6+
<js>/assets/js/jquery.modernizr.js</js>
7+
<js>/assets/js/jquery.scrollTo.js</js>
8+
<js>/assets/js/jquery.easing.min.js</js>
9+
<js>/assets/js/jquery-plugins/jquery.succinct.js</js>
10+
<js>/assets/js/bootstrap.min.js</js>
11+
<js>/assets/js/d3.js</js>
12+
<js>/assets/js/other/masonry.pkgd.js</js>
13+
<js>/assets/js/jquery-plugins/jquery.fittext.js</js>
14+
<js>/assets/js/other/scrollr.js</js>
15+
<js>/assets/js/other/imagesloaded.pkgd.min.js</js>
16+
</group>
17+
</groups>

0 commit comments

Comments
 (0)