问题标签 [wro4j]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
985 浏览

eclipse - wro4j & m2e Eclipse 未编译 LESS

我正在尝试设置我的开发人员环境,以便我可以使用 maven 编译我的 LESS 文件以进行正式构建,但也让 Eclipse 编译 LESS 以进行增量构建,这样我每次进行 LESS 更改时都不必继续执行 maven 任务. 环顾四周 - 似乎 wro4j & maven 插件 & m2e-wtp 插件应该提供所有这些。

我的设置如下:我刚刚安装了最新的稳定 Eclipse(Java EE 包,其中包括 WTP 的东西 - v4.3),并且我已经安装了 m2e 插件和 m2e-wtp 插件。

pom.xml:

wro.properties:

wro.xml:

在我的/less/文件夹中基本上是一些我已重命名的 .less 文件的 css 文件,以及我实际上添加了一些带有一些颜色变量集的 LESS 语法的文件。这主要是有效的,当我对我的 LESS 进行更改时,插件会检测并重建我的 uber css 文件,但是,相当关键的是,它似乎并没有编译 LESS - 它组合了文件并缩小了,但我@variables的全部仍然是 LESS 语法。

我还注意到 maven 插件已升级到 v 1.7.0,因此尝试升级到该插件以查看这是否是问题所在,但这根本没有做任何事情(根本没有构建任何东西,我没有 uber css 等)

任何人都有任何设置经验或知道我在设置中遗漏的任何内容?

0 投票
1 回答
127 浏览

wro4j - 带有橙色 wro4j-taglib 的 wro4j - 有时加载错误的组?

我们将 wro4j 与 Orange wr4j-taglib 一起使用,有时当我们部署它时,它会加载两次而不是两个不同的资源,但不是在所有服务器上。以下是我们在 中的小组的片段wro.xml。我们正在使用构建时解决方案,因此属性文件和所有连接文件的哈希值是在构建时生成的。

在我们的 jsps 中,我们将这两个组称为:

它最终被包含在 jsp 中:

我们检查了坏机器上的 JBoss /tmp 目录,在部署过程中它似乎被正确清除了。关于发生了什么的任何想法?

0 投票
1 回答
1600 浏览

java - 无法在 wro4j-maven-plugin (NPE) 中使用 ConfigurableWroManagerFactory

我在使用ConfigurableWroManagerFactorywroManagerFactory 时遇到了 NPE,似乎无法追查原因。似乎Context.get().getFilterConfig();返回null..

Stacktrace(这是 a 的根本原因WroRuntimeException

wro4j.version是 1.7.0

我的插件条目pom.xml

和我的wro.properties

0 投票
1 回答
1100 浏览

jetty - css改变后jetty的智能热重载

我想要一个启用热重载的 wro4j 码头,它不会仅仅因为 css 文件中的字符发生变化而杀死整个服务器几秒钟。

我已经设置 wro4j 来定位类路径之外的 css 资源。

我已经设置了 jetty 以仅查看 webapp 目录的更改:

不过,如果我更改目录 /src/main/less 中的某些内容,jetty 会自行重新启动:

我想避免重新启动,因为它很烦人。

我正在使用 wro4j 1.7.1、Maven 3.0.4 和 Jetty 9.1.0.M0。

更新:重新启动是因为我用 Eclipse 编辑了文件。否则 Jetty 不会自行重启。

0 投票
1 回答
96 浏览

maven - 构建时解决方案的 ServiceRegistry 未选择 ProcessorProvider

我已经添加src/main/resources/META-INF/services/ro.isdc.wro.model.resource.processor.support.ProcessorProvider到我的 Maven 项目中。该文件包含一行,其中包含我的 custom 的完全限定类名ProcessorProvider

运行时解决方案一切正常;但是,在构建期间我的自定义ProcessorProvider没有被调用。

我错过了一些配置吗?

0 投票
0 回答
253 浏览

servlets - Jetty ConcatServlet 处理过滤器生成的内容

我尝试使用码头ConcatServlet连接我自己的 servlet 生成的 javascript 和 wro4j 生成的 javascript WroFilter。似乎连接不起作用,不管那个 javadocConcatServlet声明它可以用来连接生成的内容。

我认为问题在于 wro4j 内容是由过滤器而不是 servlet 生成的,因为“连接”我的 servlet 生成的单个源工作正常,而“连接”单个 wro4j 生成的资源不起作用,但我得到了异常以下。它抱怨丢失的文件,尽管如果请求正常,请求 /wro/script.js 可以正常服务。有什么建议么?

0 投票
1 回答
201 浏览

maven - Wro4j image to datauri conversion in build-time

is it possible to convert via wro4j maven plugin imported into css image to uridata in build time? I see on their wiki run-time solution but I would like to have static files already converted. Or maybe somebody knows another plugin which can do this?

0 投票
1 回答
256 浏览

javascript - 使用 wro4j 创建动态 javascript 包

我正在尝试使用 wro4j 创建这个基础架构,用户可以通过编辑模板而不接触任何 java 代码来决定捆绑哪些 js 文件。因此,像 http://.../bundle/scrip1.js/scrip2.js/script3.js/script4.js 之类的请求将返回一个包含所有四个脚本的包,这些脚本按要求的顺序排列。

但是,必须事先在 xml 或自定义 WroModelFactory 实现中指定具有资源的组,仍然没有足够的自由来根据请求创建包。

关于如何解决这个问题的任何想法?

0 投票
1 回答
2939 浏览

css - Wro4j: Generate CSS file from LESS file

Editing the original question to provide all the details.

Added following in web.xml:

Created two new files wro.xml and wro.properties inside WEB-INF folder:

wro.properties:

wro.xml:

Here 'resources' is a folder inside: src/main/webapp.

A file testing.less is added inside /resources/skins/abc/ folder:

The pom.xml file contains the following entries:

I have not installed the m2e-wro4j plugin in my eclipse IDE.

Based on the above, I assume that when i do a maven build from command prompt [mvn clean install], a css file named base.css should be created inside /resources/css/test/ folder. I can see the new folder 'test' in the exploded project WAR file but it does not contain the base.css file. The console output looks something like this:

One more observation. To make sure that that wro.properties file is correctly placed and is picked up by the plugin, I tried some wrong values in this file [postProcessors=less4jtttt] and could see an exception while doing the build. However, an invalid file path in wro.xml file did not throw any exception.

0 投票
1 回答
918 浏览

maven - 引导程序 3.1.0 的 wro4j 较少处理失败

我正在针对最新的 bootstrapless 源(3.1.0)运行 wro4j-maven-plugin 1.7.3 并得到以下异常:

我在 m2e 中遇到了同样的问题 - 这与 Bootstrap 需要更新版本的 LESS 有关吗?