Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Virgo/Tooling"
(→Server Versions) |
|||
Line 10: | Line 10: | ||
*Eclipse JEE Helios SR2, or | *Eclipse JEE Helios SR2, or | ||
− | *Eclipse JEE Indigo | + | *Eclipse JEE Indigo (Recommended) |
+ | |||
+ | Note: For most users, we'd recommend installing the current snapshot build rather than the milestone build. but until then the snapshot builds will pose far fewer installation hassles, are reasonably stable and have significant bug fixes and ease of use improvements. We'll have a new milestone build soon. | ||
Installation Steps (for the milestone builds): | Installation Steps (for the milestone builds): |
Revision as of 16:37, 5 April 2012
Tooling
The Virgo Tooling/IDE concept concerns the whole Virgo tooling (that was available inside SpringSource Tool Suite) being put in a separate project.
Installation
Prerequisites, either:
- Eclipse JEE Helios SR2, or
- Eclipse JEE Indigo (Recommended)
Note: For most users, we'd recommend installing the current snapshot build rather than the milestone build. but until then the snapshot builds will pose far fewer installation hassles, are reasonably stable and have significant bug fixes and ease of use improvements. We'll have a new milestone build soon.
Installation Steps (for the milestone builds):
- Add SpringSource Tool Suite 2.7 update site to available update sites: http://dist.springsource.com/release/TOOLS/update/2.7.1.RELEASE/e3.6 (At the moment the Virgo IDE has a dependency on the Spring IDE. We are working on removing this dependency. Until we get there, you need Spring IDE installed or available at one of the update sites.)
- Go to "Install New Software" and put the Virgo IDE milestone update site into the dialog: http://download.eclipse.org/virgo/milestone/IDE.
- Select the "Core / Virgo IDE" feature and install
- Done
Installation Steps (for the snapshot builds):
- Add Eclipse Libra milestone update site: http://download.eclipse.org/libra/milestones
- Add Bundlor milestone update site: http://download.eclipse.org/virgo/milestone/BNDLR/1.1.0.M04/updatesite/
- Add Virgo update site: http://download.eclipse.org/virgo/updatesite/3.5.0.M02
- Go to "Install New Software" and put the Virgo IDE nightly snapshot update site into the dialog: http://download.eclipse.org/virgo/snapshot/IDE
- Select the "Core / Virgo IDE" feature and install
- Done
We will be working on providing an update site that points to our prerequisites, in order to simplify update site management. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=373303)
Release Notes
Current Milestone
This section lists important issues with the current Milestone release, e.g. M2.
Version Compatibility
The milestone does not work well with the current milestone of the runtime environment ("3.1.0" / 3.5.0). Please target the 3.0.2 Release Virgo Runtime or use the current snapshot build.
Current Snapshot
This section lists important changes from the prior release to the current snapshot.
Version Compatibility
The snapshot should now be supporting all versions. Please raise a bug if you have any issues.
Server Versions
The good news: We have done away with the need for managing multiple server versions. This also means that we won't have to support multiple WebTools Server Runtimes and Servers which will make adding new servers and variants much easier. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=373453 for more details.
The bad news: Any Server Runtimes that you already created for Virgo Server 3.5 will not work. But since Virgo Tooling didn't work with Virgo Server 3.5 *anyway*, this is sort of a moot issue.
What to do: If you have an existing (i.e., created using Virgo IDE installed before 10 March 2012) Virgo Server 3.5 Runtime defined, just delete it and replace it with a new Virgo Runtime in Preferences:Server:Runtime Environments. You'll see that the correct version is discovered automatically. Then, open any Servers that uses the old runtime and select the new one from the Runtime Environment popup menu.
Features
The tooling supports the following:
- Bundle projects
- Par projects
- Plan files/projects
- Web Bundles
- Deployment to a Virgo Server in the server view.
Notes
Web Application Bundles
To create a web application bundle choose to create a normal bundle project, but on the Bundle Content panel select the additional property entitled "Web Application Bundle". On the Bundle Properties panel enter a suitable context path for the application as the Web-ContextPath.
Bundlor
Bundlor is not used by default, you must create you own template file and then turn on incremental manifest generation.
PDE/Equinox Bundles not supported yet
Deploying PDE/Equinox Bundles to Virgo Web Server are not yet supported yet, although exporting the bundles (as Eclipse Plug-in JARs) and manually deploying to Virgo Web Server works. Please show your support on Bugzilla #329198.
Migration
Moving from the old tooling to the new requires some changes to your existing projects, these are documented here.
The Bundlor .settings file has a new name (com.springsource.server.ide.bundlor.core.prefs -> org.eclipse.virgo.ide.bundlor.core.prefs) and the property keys in it have new names as well. Currently these just need to be changed manually (replace com.springsource.server by org.eclipse.virgo) or use the project properties pane to create new settings and delete the old one. (recommended)
The Bundle Dependencies classpath entry has a new name (com.springsource.server.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER -> org.eclipse.virgo.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER). This can be changed manually (in the .classpath file) or in the Java Build Path section of the project properties.
The attributes used to mark folders as test folders have been renamed (com.springsource.server.ide.jdt.core.test.classpathentry -> org.eclipse.virgo.ide.jdt.core.test.classpathentry). This can be changed manually (in the .classpath file).
The PAR and Bundle nature have been renamed (com.springsource.server.ide.facet.core.bundlenature -> org.eclipse.virgo.ide.facet.core.bundlenature and (com.springsource.server.ide.facet.core.parnature -> org.eclipse.virgo.ide.facet.core.parnature)). This can be changed manually (in the .project file).
The format and name of a PAR project changed. Rename .settings/com.springsource.server.ide.runtime.core.par.xml to .settings/org.eclipse.virgo.ide.runtime.core.par.xml. Inside the file rename occurences of com.springsource.server to org.eclipse.virgo.
Snapshot build change: We've made a change in our tooling that will require modifying the org.eclipse.virgo.ide.runtime.core.par.xml file so that it points to the correct par.ecore URI. Rename xmlns:com.springsource.server.ide.par="http:///com/springsource/server/ide/par.ecore" to "xmlns:org.eclipse.virgo.ide.par="http://eclipse.org/virgo/par.ecore"
Inside the WST settings file (.settings/org.eclipse.wst.common.project.facet.core.xml) rename occurences of com.springsource.server.bundle to org.eclipse.virgo.server.bundle and occurences of com.springsource.server.par to org.eclipse.virgo.server.par.
Most/all of the conversion should be done by the following script (it has only see marginal testing, use at your own risk):
#!/bin/sh # NOTE1: Run this at your own risk :) # NOTE2: I should quote more dots in sed expressions but I'm lazy. # TODO: Delete old com.springsource files after conversion if [ ! -d "$1" ]; then echo "Please point me at an eclipse project" ; exit 1 fi # Bundlor settings f="$1/.settings/com.springsource.server.ide.bundlor.core.prefs" [ -f "$f" ] && ( echo "$1: Converting bundlor preferences" sed -e 's/com\.springsource\.server/org.eclipse.virgo/g' "$f" > "$(echo $f | sed -e s/com.springsource.server/org.eclipse.virgo/)" ) # convert PAR f="$1/.settings/com.springsource.server.ide.runtime.core.par.xml" [ -f "$f" ] && ( echo "$1: Converting PAR project dependencies" sed -e 's/com\.springsource\.server/org.eclipse.virgo/g' "$f" > "$(echo $f | sed -e s/com.springsource.server/org.eclipse.virgo/)" ) # Fix classpaths f="$1/.classpath" [ -f "$f" ] && ( echo "$1: Converting classpath containers and entries" sed -i \ -e 's/com.springsource.server.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER/org.eclipse.virgo.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER/g' \ -e 's/com.springsource.server.ide.jdt.core.test.classpathentry/org.eclipse.virgo.ide.jdt.core.test.classpathentry/g' \ "$f" ) # Fix natures.. f="$1/.project" [ -f "$f" ] && ( echo "$1: Converting project natures" sed -i \ -e 's/com.springsource.server.ide.facet.core.bundlenature/org.eclipse.virgo.ide.facet.core.bundlenature/g' \ -e 's/com.springsource.server.ide.facet.core.parnature/org.eclipse.virgo.ide.facet.core.parnature/g' \ "$f" ) # Fix the wst file, could also replace runtime name here f="$1/.settings/org.eclipse.wst.common.project.facet.core.xml" [ -f "$f" ] && ( echo "$1: Converting org.eclipse.wst.common.project.facet.core.xml" sed -i \ -e 's/com.springsource.server.bundle/org.eclipse.virgo.server.bundle/g' \ -e 's/com.springsource.server.par/org.eclipse.virgo.server.par/g' \ "$f" )
Maven plugin
To support the development of OSGi bundles for Eclipse Virgo with Maven a Maven plugin is available. This plugin is able to start/stop a local Eclipse Virgo instance. Moreover it is possible to deploy/undeploy/refresh bundles via Maven.
Build
In order to use the plugin one has to download the source code from Github and build the binary manually. This can be easily done by executing the following Maven command in the root folder of the plugin where the pom.xml file is located.
mvn clean install
Moreover to generate the documentation just execute the following Maven command (or take the one provided in the repository on Github).
mvn clean plugin:xdoc javadoc:javadoc jxr:jxr site
Goals
The plugin provides a set of Maven goals that allow different actions.
Goal | Description |
virgo:start
|
Starts a Virgo instance by executing the provided startup script.
|
virgo:shutdown
|
Stops a running Virgo instance. |
virgo:immediateShutdown
|
Stops a running Virgo instance immediately. |
virgo:deploy
|
Deploys an OSGi bundle to a running Virgo instance. |
virgo:undeploy
|
Undeploys an OSGi bundle from a running Virgo instance. |
virgo:refresh
|
Refreshs an already installed module on a running Virgo instance. |
virgo:bundleRefresh
|
Refreshs an already installed OSGi bundle on a running Virgo instance. |
Simple example POM
Once the plugin has been build and installed in the local Maven repository it can be used within a Maven project. Following is a simple example of a pom file that uses the Maven plugin.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example.osgi</groupId> <artifactId>test-bundle</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>bundle</packaging> <name>OSGi Test Bundle</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.3.6</version> <extensions>true</extensions> <configuration> <instructions> <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName> <Bundle-Name>${project.name}</Bundle-Name> <Bundle-Version>${project.version}</Bundle-Version> </instructions> </configuration> </plugin> <plugin> <groupId>net.flybyte.virgo</groupId> <artifactId>virgo-maven-plugin</artifactId> <version>1.0.0</version> <configuration> <virgoRoot>C:/Java/virgo-tomcat-server-3.0.2.RELEASE</virgoRoot> </configuration> </plugin> </plugins> </build> </project>
More examples can be found in the documentation. Following are some exemplary Maven commands.
mvn virgo:start <-- will start a Virgo instance mvn clean package virgo:deploy <-- will create an artifact and deploy it to Virgo
Importing Virgo Projects into Eclipse
See Eclipse Setup under the Committers tab.