
Untitled
By: a guest on
May 28th, 2012 | syntax:
None | size: 1.96 KB | hits: 13 | expires: Never
Executing a script from Maven 3 using exec plugin - gets blocked
echo "Uploading the site.."
lftp -u ${username},${password} sftp://${host} <<EOF
mirror -R --delete-first $sitedir $remotedir
echo "Exiting from lftp.."
bye
EOF
echo "Terminating script execution.."
<distributionManagement>
<!-- Generate the site locally, then it'll be uploaded to the server -->
<!-- Children will append their artifact ID to the base url -->
<site>
<id>project-name</id>
<name>Project Name</name>
<url>file://${env.HOME}/testsite/</url>
</site>
</distributionManagement>
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
...
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>sh</id>
<phase>site-deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sh</executable>
<arguments>
<argument>publish-site.sh</argument>
<argument>${localsitedir}</argument>
...
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>sh</id>
<phase>site-deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sh</executable>
<arguments>
<argument>../parent/publish-site.sh</argument>
<argument>${localsitedir}/child</argument>
...
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</build>