上下文
问题:
如何打包JS文件并在POM中定义构建/编译时依赖关系,以便可以轻松地跨项目共享文件? 是否可以使用URL作为文件路径而不是{project.basedir}?
示例POM代码段
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/resources/less</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/webapp/css</outputDirectory>
<compress>true</compress>
<includes>
<include>example.less</include>
</includes>
<lessJs>${project.basedir}/src/main/webapp/lib/less-1.7.0.min.js</lessJs>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>