我有一个多模块maven项目,其子模块使用sass-maven-plugin。问题是从子模块运行时一切正常,但是当从root运行整个项目时,sass插件失败。
项目设置:
+-- parent (pom.xml)
+--- child-module-1 (pom.xml)
+--- child-module-2 (pom.xml)
child-module-1使用sass-maven-plugin。
<plugin>
<groupId>org.jasig.maven</groupId>
<artifactId>sass-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<useCompass>true</useCompass>
<resources>
<resource>
<source>
<directory>${project.build.directory}/skin/sass</directory>
</source>
<destination>${project.build.directory}/skin/stylesheets</destination>
</resource>
</resources>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>update-stylesheets</goal>
</goals>
</execution>
</executions>
</plugin>
如上所述,直接从子进程运行mvn install时可以正常工作,但是当从父进程运行时,我从子进程中收到以下错误:
[ERROR] Compilation of template
/parent/child-module-1/target/skin/sass/style.scss failed:
No files were found in the load path matching "uskin/*.png".
Your current load paths are: ./images
似乎问题是从父级运行时找不到位于子模块中的config.rb。
此问题类似于此处指定的问题:https://github.com/Jasig/sass-maven-plugin/issues/43