Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse support for Glassfish 5

Does anyone know if there will be support for GlassFish 5 in Eclipse in nearer future (GlassFish Tools supports 3.1 and 4.x)?

Is there another way to integrate Glassfish in Eclipse besides GlassFish Tools?

like image 749
Flocke Avatar asked Oct 05 '17 11:10

Flocke


2 Answers

GlassFish Tools just checks for a version as follows:

Version version = getVersion();

if (!version.matches("[3.1-5)")) {
    return new Status(Status.ERROR, GlassfishToolsPlugin.SYMBOLIC_NAME, Messages.unsupportedVersion);
}

Where getVersion() is obtained from reading [install dir]/glassfish/modules/glassfish-api.jar!META-INF/MANIFEST.MF and then the Bundle-Version entry.

So a hacky way to get Eclipse working with GlassFish 5 and Payara 5 is:

  1. cd [install dir]/glassfish/modules/
  2. mkdir META-INF
  3. unzip -p glassfish-api.jar META-INF/MANIFEST.MF > META-INF/MANIFEST.MF
  4. vim META-INF/MANIFEST.MF
  5. Change Bundle-version to start with a 4 and make sure digits are all single (i.e. 181 should become 0 or so)
  6. zip -u glassfish-api.jar META-INF/MANIFEST.MF

Now you can add a runtime and server for GlassFish 5 and Payara 5 as you would normally do, and start, debug, deploy etc.

For illustration, the entry to be changed looks as follows:

Bundle-Name: Public APIs of Glassfish
Bundle-Version: 5.181.0.Alpha4-SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.8.0_144

Should become:

Bundle-Name: Public APIs of Glassfish
Bundle-Version: 4.0.0.Alpha4-SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.8.0_144

The GlassFish tooling is currently in proposal to be donated to Eclipse, so it may take a while to be updated. Meanwhile, I'm planning to create a derivative version before long with some extra enhancements, but that too may take some time.

like image 200
Arjan Tijms Avatar answered Oct 12 '22 05:10

Arjan Tijms


Eclipse Oxygen.3a (4.7.3a) now supports Glassfish 5enter image description hereenter image description here

for Eclipse photon users checkout my question and the chosen answer Cannot install Glassfish tools in Eclipse photon

like image 2
usertest Avatar answered Oct 12 '22 06:10

usertest