Time for action – serving an update site

Now that the update site has been developed, tested and automatically built, the final stage is to upload the contents of the update site (under com.packtpub.e4.update/target/repository) and make it available on a website or FTP server so that others can install it. If Python 2.7+ is installed, run a simple web server as follows.

  1. Change to the directory com.packtpub.e4.update/target/repository.
  2. Run the Python SimpleHTTPServer module (for Python 2) or the http.server module (for Python 3):
    python -m SimpleHTTPServer 8080
    Serving HTTP on 0.0.0.0 port 8080 ...
    
    python3 -m http.server 8080
    Serving HTTP on 0.0.0.0 port 8080 ...
    
  3. Verify the update site by adding http://localhost:8080/ as a remote update site in Eclipse.

If you don't have Python installed, then some operating systems have a means to serve web-based content already, or another web server can be used. macOS has web sharing where files in ~/Sites are served from, Linux systems typically have Apache configured to allow per-user web sharing in ~/public_html, and Microsoft Windows has IIS with files served from the default c:intepubwwwroot. See the operating system's documentation for details.

What just happened?

An update site is simply an HTTP server that serves the contents of the content.jar and artifacts.jar files, along with their plugins and features directories.

If Python 2.7 or above is installed, a module called SimpleHTTPServer exists which can be run from the update/target/repository directory to allow the update site to be installed from http://localhost:8080/. For Python 3 the module is called http.server. Uploading the contents of the repository to a remote website is left as an exercise for the reader.

Finally, once published to a publicly visible website, it's possible to register the location of the update site at the Eclipse marketplace at http://marketplace.eclipse.org, so that other Eclipse users can find the update site from the Marketplace client.

Pop quiz – understanding automated builds and update sites

Q1. What is a GroupId, ArtifactId and Version (GAV)?

Q2. What are the six types of packaging needed to build and test plug-ins, features, products and update sites?

Q3. How can the version numbers of plug-ins and features be updated in Maven?

Q4. Why and how are Jars signed?

Q5. How can a simple HTTP server be run in Python?

Q6. Where are Eclipse features typically registered for others to find?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.107.149