GithubHelp home page GithubHelp logo

greenpages's Introduction

Eclipse Virgo GreenPages Demo

This project is a Spring Maven project demonstrating OSGi application configuration for deployment on Eclipse Virgo.

Changes

  • 26-Apr-12

    • Properties externalized for database connection - see solution/etc/properties directory
    • Created plan file for deployment - see solution/etc/plan directory
    • Refactored directory greenpages.app to greenpages.services
  • greenpages-parent-solution pom.xml

  • Spring version 3.0.7 and surefire plugin to use corresponding spring instrument version

  • Dependencies versions specified in dependencyManagement section

  • Fixed Bundlor configuration

  • Corrected inconsistencies between template.mf files

  • Builds in Maven 3

  • Tested in Virgo 3.0.2.RELEASE

  • Does not work in 3.5.0.M3 - unable to find database driver!

TODO

  • Update to Spring 3.1.1
  • Update slf4j to 1.6.4
  • Update logback to 1.0.0
  • Provide DB connection for MySQL/MariaDB
  • JPA 2.0.0
  • EclipseLink 2.0.0(?)
  • Maven Deploy to $VWS_HOME/pickup directory

Project Layout

  • parent - Top level of Maven project
  • web - Web Application
  • jpa - Persistence Bundle
  • db - Database Configuration
  • services - application services
  • greenpages - PAR creation

Structure

  • greenpages-app-build (pom w/ modules)
    • -> parent (pom)
    • -> greenpages.db (jar)
    • -> greenpages.services (jar)
    • -> greenpages.jpa (jar)
    • -> greenpages.web (war)
    • -> greenpages (par)

Unidirectional from child to parent (greenpages)

  • greenpages (parent no modules)
    • -> greenpages-parent
    • -> greenpages-web
    • -> greenpages-jpa
    • -> greenpages-db
    • -> greenpages-services

Virgo Version Configuration

  • Virgo Dependencies

    • Created Spring 3.0.7 libd file
    • Added instrument jar to libd file (not sure if necessary)
    • Replaced Spring 3.0.5 jars with 3.0.7 in $VWS_HOME/repository/ext
  • Virgo Files

    • $VWS_HOME/configuration/org.eclipse.virgo.kernel.userregion.properties

Application Version Configuration

  • When changing dependencies, ONLY change the template.mf file, Maven Bundlor plugin will automatically generate the correct MANIFEST.MF file
  • Updating Application version should be done in all pom.xml and template.mf files

H2 Database

  • Database Location: $USER_HOME/greenpages-db/greenpages
  • Driver JAR: - $USER_HOME/.m2/repository/com/h2database/com.springsource.org.h2/1.0.71/com.springsource.org.h2-1.0.71.jar
  • Driver URL: - jdbc:h2:~/greenpages-db/greenpages
  • Port: 9092
  • Userid: greenpages
  • Password: pass
  • Driver Classname: org.h2.Driver

Versions

  • Spring: 3.1.1
  • EclipseLink: 2.4.0.RC2
  • Logback 1.0.6
  • SLF4j 1.6.6
  • JUnit: 4.10.0
  • JPA: 2.0.0

Installation

From solution directory execute:

$ mvn clean package

Deploy:

  1. Copy services, db, jpa and web jar/war files (declared in the plan file) to $VWS_HOME/repository/usr directory
  2. Copy *.property files from etc/properties directory to $VWS_HOME/repository/usr directory
  3. Copy etc/plans/greenpages.solution.plan to $VWS_HOME/pickup directory

Deploy (old):

  1. Copy the solution/target/greenpages*.par to $VWS_HOME/pickup directory
  2. Copy the solution/target/par-provided/*.jar to $VWS_HOME/repository/usr directory

Manifest Creation

Bundlor

  • Virgo's Bundlor uses the template.mf file to create the manifest in target/classes/META-INF/MANIFEST.MF
  • IMPORTANT - The Maven war configuration MUST reference the generated MANIFEST and ignore the one in src/main/webapp/WEB-INF/
  • Added Bundle-Description to the template.mf and MANIFEST.MF files. Once the packaging is done, the resulting packaged MANIFEST.MF files should be have been generated by the Bundlor.
  • Changed Bundlor to run in the "process-classes" phase to ensure it is done before packaging to avoid inadvertant overwriting by the static MANIFEST.MF file.

Contact Me

greenpages's People

Contributors

gordonad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.