Is it possible to run a Bash script from Maven?

后端 未结 7 1743
無奈伤痛
無奈伤痛 2021-02-05 01:53

For creating configuration of my application I need to run bash script. Is it possible to integrate execution of Bash scripts in Maven, maybe there are some plugins?

相关标签:
7条回答
  • 2021-02-05 02:59

    Solved. The problem is, executable is working in a different way for bash. This code is working. Write it in pom.xml

        <plugin>
            <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
            <groupId>org.codehaus.mojo</groupId>
            <executions>
                <execution><!-- Run our version calculation script -->
                    <id>Renaming build artifacts</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>bash</executable>
                <commandlineArgs>handleResultJars.sh</commandlineArgs>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    
    0 讨论(0)
提交回复
热议问题