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?
Maven Shell is a CLI interface for Maven that enables faster turn-around, and a more intelligent interaction with repositories and projects.
Could the Bash Maven Plugin help you? (Disclaimer: I initiated it, so please send me feedback)
<build> <plugins> <plugin> <!-- Run with: mvn bash:run mvn install --> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>bash-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>test</id> <phase>integration-test</phase> <goals> <goal>run</goal> </goals> </execution> </executions> <configuration> <script> # Here you can execute shell commands echo "Tomcat will start" /opt/apache-tomcat/bin/startup.sh </script> </configuration> </plugin> </plugins> </build>
You will need to install this maven plugin in your own Maven repo.
Like Konstantin: When you execute a shell script, you're not portable anymore.
You can do this, see answer:
I want to execute shell commands from maven's pom.xml
But it is not advisable, as this produces not so portable builds. Why do you need this in first place? Using this plugin usually indicates some weird necessity in project build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With