Does the Java library manage CSS explosion or reuse?

Java asks:

I'd love to use sass and compass, but they are Ruby programs, which will probably require some interesting maven jruby love to work on Java Web application development This can also be difficult if you are using eclipse or any ide that supports synchronization with a running web application

Is there a better alternative to hell is CSS and hell is Java?

Solution

Recently, I used the same technology lesscss down the same road At first I tried to embed jruby into my build lifecycle Unfortunately, maven jruby is a monster. It's slow, huge and off-road (it won't even start half the time because it complains about the running file path)

Fortunately, there is now a JavaScript port for lesscss, which I now embed through Mozilla rhino I describe the process in this blog post

Yesterday I took it to a new level and made a maven lesscs plugin to minimize POM configuration and code duplication Unfortunately, I can't share it because it's proprietary code for my current client, but the solution is simple:

Use gmaven to create the plugin, create an abstract basic mojo, call the lesscss compiler and configure several specific implementations of the basic mojo for different resource sets:

for example

>Lesscss: compile all compilers < Resources > to ${} project build. Outputdirectory > lesscss: Test compile compile all < testresources > to ${} project build. Testoutputdirectory > lesscss: War compile (compiles from all Src / main / webapp to ${project. Build. Directory} / ${} project. Build. Finalname, explosive war directory)

So, although I can't help you sass (except that you require authentication or port it to groovy, Java or JavaScript), I think I've shown you a feasible alternative

Of course, you can also implement a maven plug-in in Java without groovy (also embedded JavaScript through rhino), but I think groovy is easier

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>