diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

p2 director and Customizing Metadata #19

Closed dmei77 closed 7 years ago

dmei77 commented 7 years ago

I tried to install a feature that uses the p2 Metainformation Mechanism (see http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata). It seems that, the stripped down p2 bootstrap director can not this. The case can be easily checked using this project: https://github.com/Villane/org.zeroturnaround.example.p2. The following error message appears:

!ENTRY org.eclipse.equinox.p2.engine 4 4 2016-11-28 17:03:17.161
!MESSAGE An error occurred while installing the items
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2016-11-28 17:03:17.161
!MESSAGE session context was:(profile=OomphIde, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.zeroturnaround.example.p2.main 1.0.0.201611281558, action=org.eclipse.equinox.internal.p2.engine.MissingAction).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2016-11-28 17:03:17.161
!MESSAGE No action found for: org.zeroturnaround.example.p2.spells.onInstall.
!STACK 0
java.lang.IllegalArgumentException: No action found for: org.zeroturnaround.example.p2.spells.onInstall.

Any idea?

nedtwigg commented 7 years ago

Can you link to the build.gradle that's causing the error?

Normally, the execution is handled by calling P2Model.runUsingBootstrapper(). But we can also use the bootstrapper to download a bigger install, e.g. the SDK, and use that SDK to run the provisioning operation. e.g. P2Model.runUsing(PdeInstallation.from(EclipseRelease.latestOfficial()).

If the bootstraper is just missing a 500kb jar, then of course it would be better to add that jar to the bootstrapper, but first we'd need to know what is missin.

With a build.gradle to test against, I think we can fix this.

dmei77 commented 7 years ago

Here is a simple test procedure

dominic@horus:~/mkdir test
dominic@horus:~/cd test
dominic@horus:~/test/git clone https://github.com/Villane/org.zeroturnaround.example.p2.git
dominic@horus:~/test/cd org.zeroturnaround.example.p2/
dominic@horus:~/test/org.zeroturnaround.example.p2/mvn package
dominic@horus:~/test/org.zeroturnaround.example.p2/cd ..
dominic@horus:~/test/vi build.gradle
dominic@horus:~/test$ cat build.gradle
buildscript {
    repositories {
        // make it easy to test a snapshot version of goomph
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
        // grab dependencies from the gradle plugin portal
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    // make sure we don't cache stale snapshot versions
    configurations.all {
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    dependencies {
        // a bunch of eclipse stuff
        classpath "com.diffplug.gradle:goomph:3.0.6"
        // creates a targetplatform
        classpath "org.standardout:bnd-platform:1.4.0"
    }
}

apply plugin: 'com.diffplug.gradle.oomph.ide'

oomphIde {
    repoEclipse '4.5.2'
    // jdt {}
    eclipseIni {
        vmargs('-Xmx2g')    // IDE can have up to 2 gigs of RAM
    }
    style {
        classicTheme()  // oldschool cool
        niceText()      // with nice fonts and visible whitespace
    }

    repo 'file:///home/dominic/test/org.zeroturnaround.example.p2/org.zeroturnaround.example.p2.updatesite/target/site'
    feature 'org.zeroturnaround.example.p2.feature'
}
dominic@horus:~/test$ gradle --version

------------------------------------------------------------
Gradle 2.10
------------------------------------------------------------

Build time:   2016-01-26 15:17:49 UTC
Build number: none
Revision:     UNKNOWN

Groovy:       2.4.5
Ant:          Apache Ant(TM) version 1.9.6 compiled on July 8 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Linux 4.4.0-47-generic amd64
nedtwigg commented 7 years ago

I published a workaround to 3.6.0-SNAPSHOT. You can see it for your case here, and some of the reasoning behind it here.

I'd like to fix the underlying problem with the bootstrapper, but I don't have time to investigate. These are the jars in the bootstrapper. Do you know what's missing?

nedtwigg commented 7 years ago

The workaround described above was shipped in 3.6.0. Feel free to reopen if you find anything new.