Closed HaasJona closed 7 years ago
Looking at the Features shows that one source plugin has an incorrect maven-like version number
Yes, that's strange. If it the source bundle is processed by bnd-platform it should OSGify the version.
Can you show the excerpt of your build.gradle where you add the dependency to your plugin? Do you build your plugin also with the same Gradle build or does this happen somewhere else?
Also I'm wondering if it's possible to remove the org.eclipse.* plugins from the feature/updatesite because while they're a dependency, I don't really want to publish them in my own updatesite.
If the Eclipse stuff is recognized as dependency because they are transitive Maven dependencies (e.g. provided via unpuzzle or the like), then you can use the standard mechanism in Gradle to exclude them from the platform configuration (and thus from the update site).
Can you show the excerpt of your build.gradle where you add the dependency to your plugin?
This is the project that creates the feature:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.standardout:bnd-platform:1.4.0'
}
}
defaultTasks 'clean', 'updateSiteZip'
apply plugin: 'org.standardout.bnd-platform'
platform {
//fetchSources = false
}
dependencies {
platform project(':de.plugin.dobj')
}
de.plugin.dobj
is a goomph project that builds a eclipse plugin. It has dependencies to the "my.plugin" and to the eclipse bundles. "my.plugin" is build via tycho and put into a local maven repo, but not sure if that matters.
If the Eclipse stuff is recognized as dependency because they are transitive Maven dependencies (e.g. provided via unpuzzle or the like), then you can use the standard mechanism in Gradle to exclude them from the platform configuration (and thus from the update site).
Thanks, didn't realized it was that easy.
I found that dependencies on projects are not so easy to deal with (or I just don't have the necessary knowledge of the Gradle internals), see also this issue.
What you could try is instead adding your plugin via the local maven repo. Something like this:
repositories {
mavenLocal()
}
dependencies {
platform "mygroup:myplugin:$pluginVersion"
}
What you could try is instead adding your plugin via the local maven repo. Something like this:
Weird, that makes the source plugin appear twice, and one time with correct version.
<feature id="xxx" label="xxx" version="1.0.0.bnd-Ovs7LA" provider-name="xxx">
<plugin id="my.plugin" download-size="0" install-size="0" version="1.0.0.201608151337" unpack="false"/>
<plugin id="my.plugin.source" download-size="0" install-size="0" version="1.0.0-SNAPSHOT" unpack="false"/>
<plugin id="my.plugin.source" download-size="0" install-size="0" version="1.0.0.201608151337" unpack="false"/>
</feature>
Strange, no idea where the second one could come from. When you disable fetchSources
both are removed?
When you disable fetchSources both are removed?
Yes.
I will try to investigate, I realize that my project might be strange. Just trying to automate building eclipse plugins and features with gradle.
I assume your project is not publicly available somewhere so I could try to reproduce and look for a likely candidate for the cause?
Anyway, this would be what I would probably check:
Also, a simple workaround may be, that before the updateSite
task, but after bundles
, you delete the undesired source Jar. Not pretty, but easy and fast to implement.
I assume your project is not publicly available somewhere so I could try to reproduce and look for a likely candidate for the cause?
No, unfortunately there is some company specific code in there that I can't release into the public. I will try to create a minimal example when I have some time.
I get the same problem when I'm resolving artifacts from my local maven repository.
For me it looks like the source artifacts are added twice:
Therefore my feature.xml is looking like this;
...
<plugin id="com.example.artifact" download-size="0" install-size="0" version="4.0.0.SNAPSHOT" unpack="false" />
<plugin id="com.example.artifact.source" download-size="0" install-size="0" version="4.0.0-SNAPSHOT" unpack="false" />
<plugin id="com.example.artifact.source" download-size="0" install-size="0" version="4.0.0.SNAPSHOT" unpack="false" />
...
I have another example with an artifact that is already a bundle. Due to some misconfigurations the bundle version is not identical to the maven version. This will lead to the following:
...
<plugin id="gsa-dataService-common" download-size="0" install-size="0" version="3.0.9.20151029122409" unpack="false" />
<plugin id="gsa-dataService-common.source" download-size="0" install-size="0" version="3.0.9" unpack="false" />
<plugin id="gsa-dataService-common.source" download-size="0" install-size="0" version="3.0.9.20151029122409" unpack="false" />
...
Funnily in the plugins dir the file there is only one file with the correct version in both cases.
Maybe I'm doing something wrong, but I have a plugin and the corresponding source plugin in a local maven repository. I'm trying to create a feature and updatesite from them, but I get the following exception when building the updatesite:
Looking at the Features shows that one source plugin has an incorrect maven-like version number:
The corresponding binary plugin has a correct version, so I'm not sure what's going on here. Disabling the source plugins with
solves the problem, but I would like to include the sources on my updatesite.
Also I'm wondering if it's possible to remove the org.eclipse.* plugins from the feature/updatesite because while they're a dependency, I don't really want to publish them in my own updatesite.