Calling foreach in maven-antrun-plugin

我与影子孤独终老i 提交于 2019-12-04 07:30:15

The ant plugin does not appear to support the declaration of more than one target section. You can check the generated ANT script to see what I'm talking about:

target/antrun/build-main.xml

Digging deeper the plug-in documentation states the following:

It is not the intention of this plugin to provide a means of polluting the POM, so it's encouraged to move all your Ant tasks to a build.xml file and just call it from the POM using Ant's task.

Harsh words, but the advice is sound. I'd recommend moving your ANT logic into a dedicated file and invoke it as follows:

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <configuration>
                        <target>
                            <ant antfile="${basedir}/src/main/ant/build.xml"/>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

You are aware of the lesscss-maven-plugin which i think should solve your problems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!