开发者

Eclipse and Maven: Run goal after a file is changed

开发者 https://www.devze.com 2023-02-06 13:41 出处:网络
I have a maven goal configured in the pom that is executed on compile phase. But also I need that goal to run after a specific file is changed to keep everything always up to date.

I have a maven goal configured in the pom that is executed on compile phase. But also I need that goal to run after a specific file is changed to keep everything always up to date.

i.e I want to save the file "objects.xml" and run the goal "transform" to apply XSL every time a change is done.

Is there a way for doing that from inside开发者_C百科 Eclipse?

I've been reading about custom builders for the project, but that does not cover my case.


You can add builders and custom ant scripts to your eclipse workspace.

Project->Preferences->Builders

These builders can be automatically be added to you project with

mvn eclipse:eclipse

By adding the folling config to your pom

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <configuration>
                <additionalBuildcommands>
                    <buildcommand>your.custom.Builder</buildcommand>
                </additionalBuildcommands>

for more info how to do this see the maven-eclipse-plugin website

http://maven.apache.org/plugins/maven-eclipse-plugin/

0

精彩评论

暂无评论...
验证码 换一张
取 消