Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: None  |  size: 1.96 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Executing a script from Maven 3 using exec plugin - gets blocked
  2. echo "Uploading the site.."
  3. lftp -u ${username},${password} sftp://${host} <<EOF
  4. mirror -R --delete-first $sitedir $remotedir
  5. echo "Exiting from lftp.."
  6. bye
  7. EOF
  8. echo "Terminating script execution.."
  9.        
  10. <distributionManagement>
  11.  <!-- Generate the site locally, then it'll be uploaded to the server -->
  12.  <!-- Children will append their artifact ID to the base url  -->
  13.  <site>
  14.   <id>project-name</id>
  15.   <name>Project Name</name>
  16.   <url>file://${env.HOME}/testsite/</url>
  17.  </site>
  18. </distributionManagement>
  19. ...
  20. <build>
  21. <pluginManagement>
  22.  <plugins>
  23.   <plugin>
  24.    <groupId>org.codehaus.mojo</groupId>
  25.    <artifactId>exec-maven-plugin</artifactId>
  26.    <version>1.2.1</version>
  27.   </plugin>
  28.  </plugins>
  29. </pluginManagement>
  30. <plugins>
  31.  <plugin>
  32.   <groupId>org.apache.maven.plugins</groupId>
  33.   <artifactId>maven-site-plugin</artifactId>
  34.   <version>3.0</version>
  35.   <configuration>
  36.     ...
  37.  </plugin>
  38.  <plugin>
  39.   <groupId>org.codehaus.mojo</groupId>          
  40.   <artifactId>exec-maven-plugin</artifactId>
  41.   <inherited>false</inherited>
  42.   <executions>
  43.    <execution>
  44.     <id>sh</id>
  45.     <phase>site-deploy</phase>
  46.     <goals>
  47.      <goal>exec</goal>
  48.     </goals>
  49.     <configuration>
  50.      <executable>sh</executable>
  51.      <arguments>
  52.       <argument>publish-site.sh</argument>
  53.       <argument>${localsitedir}</argument>
  54.       ...
  55.      </arguments>
  56.     </configuration>
  57.    </execution>
  58.   </executions>
  59.  </plugin>
  60. </plugins>
  61. </build>
  62.        
  63. <build>
  64.  <plugin>
  65.   <groupId>org.codehaus.mojo</groupId>          
  66.   <artifactId>exec-maven-plugin</artifactId>
  67.   <executions>
  68.    <execution>
  69.     <id>sh</id>
  70.     <phase>site-deploy</phase>          
  71.     <goals>
  72.      <goal>exec</goal>
  73.     </goals>
  74.     <configuration>
  75.      <executable>sh</executable>
  76.      <arguments>
  77.       <argument>../parent/publish-site.sh</argument>
  78.       <argument>${localsitedir}/child</argument>
  79.       ...
  80.      </arguments>
  81.     </configuration>
  82.    </execution>
  83.   </executions>
  84.  </plugin>
  85. </build>