簡體   English   中英

給定較長路徑的Maven yui壓縮器插件無法創建聚合?

[英]Maven yui compressor plugin cannot create aggregation given a longer path?

我正在嘗試創建兩個css聚合 - 一個用於公共站點,另一個用於站點的應用程序部分。

如果我輸出文件${project.build.directory}/${project.build.finalName}/css/public-all.css ,一切正常。

[INFO] generate aggregation : C:\Users\me\IdeaProjects\myapp-development\target\myapp-1.0\css\public-all.css
[INFO] public-all.css (32029b)
[INFO] generate aggregation : C:\Users\me\IdeaProjects\myapp-development\target\myapp-1.0\css\application-all.css
[INFO] application-all.css (50446b)

但是,如果我嘗試將聚合文件輸出到另一個子目錄,例如${project.build.directory}/${project.build.finalName}/css/public/all.css ,則會出現以下錯誤:

[INFO] generate aggregation : C:\Users\me\IdeaProjects\myapp-development\target\myapp-1.0\css\public\all.css
[WARNING] all.css not created
[INFO] generate aggregation : C:\Users\me\IdeaProjects\myapp-development\target\myapp-1.0\css\application\all.css
[WARNING] all.css not created

為什么他們沒有被創造? 為什么這甚至是一個警告而不是插件的失敗?

這是我指定聚合的pom.xml部分。 為什么這不起作用?

                    <aggregation>
                        <removeIncluded>false</removeIncluded>
                        <insertNewLine>true</insertNewLine>
                        <output>${project.build.directory}/${project.build.finalName}/css/public/all.css</output>
                        <includes>
                            <include>**/public/base.css</include>
                            <include>**/fancybox/jquery.fancybox-1.3.4.css</include>
                        </includes>
                    </aggregation>
                    <aggregation>
                        <removeIncluded>false</removeIncluded>
                        <insertNewLine>true</insertNewLine>
                        <output>${project.build.directory}/${project.build.finalName}/css/application/all.css</output>
                        <includes>
                            <include>**/application/reset.css</include>
                            <include>**/application/text.css</include>
                            <include>**/application/960.css</include>
                            <include>**/smoothness/jquery-ui-1.8.11.custom.css</include>
                            <include>**/application/base.css</include>
                            <include>**/jcrop/jquery.jcrop.css</include>
                            <include>**/farbtastic/farbtastic.css</include>
                        </includes>
                    </aggregation>

我檢查過,這些目錄也存在。 如果我嘗試指向不存在的目錄, yuicompressor:compress將失敗。 我只是不明白為什么構建過程實際成功給定有效目錄,但它不會在這些目錄中創建文件。 這沒有道理!

我想也許這可能是一個文件系統安全問題,但事實並非如此。

我真的很困惑,為什么這不起作用。

請幫忙。

我有一個類似的問題,我解決了配置inputDir指向我的js結構的根目錄。 默認情況下,插件將輸出文件的父目錄作為基礎,並且includes將表現為相對於它(如果不是絕對路徑)。

<inputDir>src/main/js</inputDir>
<includes>
  <include>**/*.js</include>
</includes>
<output>${webapp.root.dir}/js/${project.artifactId}-${project.version}.js</output>

希望這可以幫助 :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM