public class MavenCentralPlugin extends ProjectPlugin
Now that Eclipse is publishing artifacts to maven central, it’s possible to use the valuable components of the eclipse project without getting bogged down in p2 and OSGi.
The trouble is that it can be difficult to get a coherent set of versions across the many bundles. It’s also a little tricky to know what the groupId:artifactId mapping is, since eclipse artifacts only have a bundleId by default.
Here is the fix:
apply plugin: 'com.diffplug.gradle.eclipse.mavencentral'
eclipseMavenCentral {
release '4.7.0', {
compile 'org.eclipse.jdt'
testCompile 'org.eclipse.jdt'
dep 'compile', 'org.eclipse.jdt'
}
}
If you want to add a specific jar to match the native system, there is a special sourceSetNative method, along with builtins like testRuntimeNative for each of the builtin java configurations.
eclipseMavenCentral {
release '4.7.0', {
testRuntimeNative 'org.eclipse.swt'
nativeDep 'testRuntime', 'org.eclipse.swt'
}
}
Either of the above lines will add the org.eclipse.swt.win32.win32.x86_64 as a testRuntime dependency if you’re running on a 64-bit JVM on Windows, or some whichever platform-specific jar is appropriate. This works only for the SWT naming convention, windowing.os.arch.
Only works with versions from 4.6.2 onwards.
| Constructor and Description |
|---|
MavenCentralPlugin() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyOnce(Project project)
Plugin application, which is guaranteed to execute only once.
|
apply, getPlugin, treeDefprotected void applyOnce(Project project)
ProjectPluginPlugin application, which is guaranteed to execute only once.
applyOnce in class ProjectPlugin