Monday, 15 June 2015

How to execute scripts(.ksh,.sh stc) by maven

Use Maven exec plugin to execute the script.
In <executable> you can specify the type of file.
In <workingDirectory> provide the path to the script file.
In <arguments> provide the script file name and any parameter used inside the script.

       <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                         <execution>
                            <id>createSymLinks</id>
                            <phase>install</phase>
                            <goals>
                              <goal>exec</goal>
                                                        </goals>
                            <configuration>
                                      <executable>ksh</executable>
                                      <workingDirectory>${env.HOME}/config/src
                                      </workingDirectory>
                                      <arguments>
                                                  <argument>create_links.ksh</argument>
                                                  <argument>${BUILD_VERSION}</argument>
                                       </arguments>
                            </configuration>
                         </execution>
                   </executions>
        </plugin>

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...