Deploying to sourceforge.net

This sf.net announcement indicates that the new hostname for project web file management has changed. The new hostname for file management is: web.sourceforge.net and the new accepted methods are: SFTP, SCP, rsync over SSH. Unfortunately web.sourceforge.net also has a restricted shell environment and does not allow remote commands to be executed.

In addition shell access to shell.sourceforge.net now requires the creation of a shell before it can be accessed.

Both of these mean that if you attempt to deploy your site without following these steps you will get an error.

Quick Start

  • Create a shell on shell.sourceforge.net with your username and project group
    ssh -t <username>,<project name>@shell.sf.net create
    
  • Use shell.sourceforge.net (instead of web.sourceforge.net) in you site URL
      ...
      <distributionManagement>
        ...
        <site>
          <id>your_project.sf.net</id>
          <url>scp://shell.sourceforge.net/home/project-web/your_project/htdocs</url>
        </site>
      </distributionManagement>
    
  • Run mvn site:deploy
  • Verify that you have a working web site by opening a browser to http://your_project.sf.net

Detailed Instructions with Examples

The following examples will use the qifcon project and the user barrie. Substitute these with your own project name and user name.

Create a shell on shell.sourceforge.net with your username and project group

  1. $ ssh -t barrie,qifcon@shell.sf.net create
  2. barrie,qifcon@shell.sf.net's password:
  3.  
  4. Requesting a new shell for "barrie" and waiting for it to start.
  5. queued... creating... starting...
  6.  
  7. This is an interactive shell created for user barrie,qifcon.
  8. Use the "timeleft" command to see how much time remains before shutdown.
  9. Use the "shutdown" command to destroy the shell before the time limit.
  10. For path information and login help, type "sf-help".
  11.  
  12. -bash-3.2$

Use shell.sourceforge.net (instead of web.sourceforge.net) in you site URL

In the project's pom.xml:

  1. ...
  2. <distributionManagement>
  3. ...
  4. <site>
  5. <id>qifcon.sf.net</id>
  6. <url>scp://shell.sourceforge.net/home/project-web/qifcon/htdocs</url>
  7. </site>
  8. </distributionManagement>
  9. ...

Run mvn site:deploy

  1. C:\ide\Finance\qifcon\site>mvn site:deploy
  2. [INFO] Scanning for projects...
  3. [INFO] Searching repository for plugin with prefix: 'site'.
  4. [INFO] ------------------------------------------------------------------------
  5. [INFO] Building QifCon
  6. [INFO] task-segment: [site:deploy]
  7. [INFO] ------------------------------------------------------------------------
  8. [INFO] [site:deploy]
  9. Using private key: C:\Projects\putty\barrie@sourceforge-net.openssh
  10. scp://shell.sourceforge.net/home/groups/q/qi/qifcon/htdocs - Session: Opened
  11. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/.
  12. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/.
  13. Executing command: scp -t /home/groups/q/qi/qifcon/htdocs/./wagon51463.zip
  14. Uploading: ./wagon51463.zip to scp://shell.sourceforge.net/home/groups/q/qi/qifcon/htdocs
  15.  
  16. ########################
  17. Transfer finished. 95979 bytes copied in 1.812 seconds
  18. Executing command: cd /home/groups/q/qi/qifcon/htdocs/.; unzip -q -o wagon51463.zip; rm -f wagon51463.zip
  19. Executing command: chmod -Rf g+w,a+rX /home/groups/q/qi/qifcon/htdocs
  20. scp://shell.sourceforge.net/home/groups/q/qi/qifcon/htdocs - Session: Disconnecting
  21. scp://shell.sourceforge.net/home/groups/q/qi/qifcon/htdocs - Session: Disconnected
  22. [INFO] ------------------------------------------------------------------------
  23. [INFO] BUILD SUCCESSFUL
  24. [INFO] ------------------------------------------------------------------------
  25. [INFO] Total time: 30 seconds
  26. [INFO] Finished at: Sat Nov 08 08:09:40 CST 2008
  27. [INFO] Final Memory: 6M/11M
  28. [INFO] ------------------------------------------------------------------------

Verify you have a working web site

Open a browser to http://qifcon.sf.net.

Troubleshooting

Trying to deploy to web.sourceforge.net

The accepted methods for deploying to web.sourceforge.net are: SFTP, SCP, rsync over SSH.

This will mean that the zipped archive created by Wagon can be uploaded, but the commands that Wagon uses to create directories, unzip and chmod files will fail silently.

There are two types of failures:

  1. No such file or directory

    This will occur if you are deploying into a subdirectory that does not yet exist. The cause is that the mkdir command has failed silently.

    An example of this error:

    1. C:\ide\Finance\qifcon\site>mvn site:deploy
    2. [INFO] Scanning for projects...
    3. [INFO] Searching repository for plugin with prefix: 'site'.
    4. [INFO] ------------------------------------------------------------------------
    5. [INFO] Building QifCon
    6. [INFO] task-segment: [site:deploy]
    7. [INFO] ------------------------------------------------------------------------
    8. [INFO] [site:deploy]
    9. Using private key: C:\Projects\putty\barrie@sourceforge-net.openssh
    10. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Opened
    11. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/site/.
    12. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/site/.
    13. Executing command: scp -t /home/groups/q/qi/qifcon/htdocs/site/./wagon12736.zip
    14. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Disconnecting
    15. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Disconnected
    16. [INFO] ------------------------------------------------------------------------
    17. [ERROR] BUILD ERROR
    18. [INFO] ------------------------------------------------------------------------
    19. [INFO] Error uploading site
    20.  
    21. Embedded error: SCP terminated with error: 'scp: /home/groups/q/qi/qifcon/htdocs/site/./wagon12736.zip: No such file or directory'
    22. [INFO] ------------------------------------------------------------------------
    23. [INFO] For more information, run Maven with the -e switch
    24. [INFO] ------------------------------------------------------------------------
    25. [INFO] Total time: 15 seconds
    26. [INFO] Finished at: Sat Nov 08 07:27:34 CST 2008
    27. [INFO] Final Memory: 6M/11M
    28. [INFO] ------------------------------------------------------------------------
  2. Unable to unzip the zip file created by Wagon

    If the directory exists then the Wagon zip file can be uploaded and site:deploy will appear to succeed, but the web site will not work since the Wagon zip file can not be unzipped.

    1. C:\ide\Finance\qifcon\site>mvn site:deploy
    2. [INFO] Scanning for projects...
    3. [INFO] Searching repository for plugin with prefix: 'site'.
    4. [INFO] ------------------------------------------------------------------------
    5. [INFO] Building QifCon
    6. [INFO] task-segment: [site:deploy]
    7. [INFO] ------------------------------------------------------------------------
    8. [INFO] [site:deploy]
    9. Using private key: C:\Projects\putty\barrie@sourceforge-net.openssh
    10. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Opened
    11. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/site/.
    12. Executing command: mkdir -p /home/groups/q/qi/qifcon/htdocs/site/.
    13. Executing command: scp -t /home/groups/q/qi/qifcon/htdocs/site/./wagon21889.zip
    14. Uploading: ./wagon21889.zip to scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site
    15.  
    16. ########################
    17. Transfer finished. 95979 bytes copied in 1.872 seconds
    18. Executing command: cd /home/groups/q/qi/qifcon/htdocs/site/.; unzip -q -o wagon21889.zip; rm -f wagon21889.zip
    19. Executing command: chmod -Rf g+w,a+rX /home/groups/q/qi/qifcon/htdocs/site
    20. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Disconnecting
    21. scp://web.sourceforge.net/home/groups/q/qi/qifcon/htdocs/site - Session: Disconnected
    22. [INFO] ------------------------------------------------------------------------
    23. [INFO] BUILD SUCCESSFUL
    24. [INFO] ------------------------------------------------------------------------
    25. [INFO] Total time: 18 seconds
    26. [INFO] Finished at: Sat Nov 08 07:51:04 CST 2008
    27. [INFO] Final Memory: 6M/11M
    28. [INFO] ------------------------------------------------------------------------

No shell created error

If you try to run ssh without first creating a shell you will get the following error:

  1. $ ssh barrie,qifcon@shell.sf.net
  2. barrie,qifcon@shell.sf.net's password:
  3. Logging in to your interactive shell...
  4.  
  5. You don't have an active shell at this time. For basic file transfers and
  6. management, use web.sourceforge.net -- it allows rsync, sftp, and scp access.
  7.  
  8. If you would like to create a shell, use ssh to login using a USER,PROJECT
  9. username with the "create" command. If you tell ssh to allocate a tty
  10. (e.g. using -t), an interactive shell will be opened when the create is
  11. done. Otherwise, the create command will exit when the shell becomes
  12. ready for use. An example create that enters the shell when ready:
  13.  
  14. ssh -t USER,PROJECT@shell.sourceforge.net create
  15.  
  16. Connection to shell.sf.net closed.