Comments (6)
How you add your bundle to the bnd-platform configuration? What mechanism are you using?
Are you adding it as Maven dependency? Then there would be two options
- add it to the platformaux configuration instead of the platform configuration or
- explicitly exclude the dependencies (via the corresponding Gradle syntax for that)
from bnd-platform.
Perhaps this is more clear if i give you all information using the github link : https://github.com/ANRGenstar/gamaplugin
I'm using the goomph gradle plugin, which also use bnd-platform, to download p2 (build.gradle of target.p2 folder) and maven (build.gradle of target.maven folder) dependencies used for my eclipse-plugin src/
compilation (genstar.plugin.bundle-all
folder).
from bnd-platform.
I'm not so familiar with this kind of setup.The dependency seems to be added here to the bnd-platform configuration. Project dependencies behave a bit differently than Maven dependencies, so that's often not so easy to deal with.
You could try to change platform
to platformaux
in line 22. Not sure if that will work.
As an alternative you could exclude the dependencies you want to exclude similar to line 18.
With gradle dependencies
you can check what dependencies are listed for the platform configuration.
from bnd-platform.
I try to change platform
to platformaux
without success :
* What went wrong:
A problem occurred evaluating project ':target.maven'.
> java.lang.NullPointerException (no error message)
I try the alternative by excluding transitive manually in genstar.plugin.bundle-all/build.gradle
:
dependencies {
compile ('p2:ummisco.gama.annotations:+')
compile ('p2:msi.gama.core:+')
compile ('org.genstar:genstar-core:1.0')
{
exclude group:'org.geotools'
}
compile ('org.genstar:genstar-spll:1.0')
{
exclude group:'org.geotools'
exclude group:'org.jfree'
}
compile ('org.genstar:genstar-spin:1.0')
{
exclude group:'org.geotools'
}
compile ('org.genstar:genstar-gospl:1.0') {
exclude group:'org.geotools'
}
}
Hum there is something i don't understand using updatesite
... the jar created by bnd + conditional-package into /genstar.plugin.bundle-all/build/libs/genstar.plugin.bundle-all
do not respect my bnd instruction :
// configure the OSGi bundle
jar.manifest.attributes(
'-exportcontents': 'core.*, gospl.*, spin.*, spll.*',
'-removeheaders': 'Bnd-LastModified,Bundle-Name,Created-By,Tool,Private-Package,Require-Capability',
'-conditionalpackage': '!org.w3c.*, !org.xml.*, !javax.*, *',
'Import-Package': '!org.w3c.*, !org.xml.*, !javax.*,*',
'Bundle-Version': '1.0.0.${tstamp}',
'Bundle-SymbolicName': project.name,
'Bundle-RequiredExecutionEnvironment': 'JavaSE-1.8',
'Require-Capability': 'osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"',
'Bundle-Vendor': 'Gama team',
'Bundle-License': "http://www.apache.org/licenses/LICENSE-2.0"
)
As maven permits, is it possible to push the p2repository by ssh using gradle after that ?
from bnd-platform.
I think there's a little confusion. goomph
and bnd-platform
are separate projects - they don't depend on each other, but they do complement each other.
The jar.manifest.attributes
stuff that you're mentioning above, that gets used by com.diffplug.gradle.osgi.bndmanifest
, not by bnd-platform
. bndmanifest
is Goomph plugin that uses bnd to generate manifests for the plugin YOU are developing. bnd-platform
is this plugin, which downloads dependencies from maven and calls bnd to wrap YOUR DEPENDENCIES with appropriate OSGi metadata. Apparently it also has some updatesite functionality, but I don't know much about it.
Looking at your source, I think you're mixing up the place where you download your dependencies from maven, with the place where you can publish your result.
I think you want to make a separate project publish
, by adding a line to your settings.gradle
file. I bet something close to this will work for you as the build.gradle for that:
configurations {
platformaux
}
dependencies {
platformaux project(':genstar.plugin.bundle-all')
}
apply plugin: 'org.standardout.bnd-platform'
from bnd-platform.
Thanks for you help @nedtwigg and @stempler !
I separate the project like you propose :
── build.gradle
├── build.properties
├── genstar.plugin.bundle-all
│ ├── build
│ ├── build.gradle
│ ├── build.properties
│ ├── META-INF
│ └── src
├── genstar.plugin.platform
│ ├── build
│ ├── build.gradle
│ └── build.properties
├── gradle
│ └── wrapper
├── gradlew
├── gradlew.bat
├── settings.gradle
├── target.maven
│ ├── build
│ └── build.gradle
├── target.p2
│ ├── build
│ ├── build.gradle
│ └── workspace
└── workspace
This is not perfect, i run first gradle build
to build my unique jar genstar.plugin.bundle-all.jar
, then cd genstar.plugin.platform
, then gradle updateSite
to generate p2 site.
I remove all import-package
into osgi bundle of my unique jar genstar.plugin.bundle-all.jar
. In the future i certainly try to mix the two approaches in platform folder/subproject, by making somme dependencies (Import Package
) as Optional
, and ask to bnd-platform
to wrap these optional dependencies and include them with into p2 repository with genstar.plugin.bundle-all.jar
.
from bnd-platform.
Related Issues (20)
- Support for Gradle 3/4 HOT 3
- Create 1.6 release and publish 1.7 snapshot? HOT 4
- "Could not retrieve POM" spam HOT 2
- SSL issues with cloudfront.net when trying to download Eclipse HOT 4
- Avoid 'Require-Capability' header? HOT 2
- Generated update site does not work HOT 3
- OptionalImport not working HOT 2
- feature.xml does not contain all dependencies HOT 2
- Setting buildDir does not work HOT 2
- fetchSources = true adds source bundles to feature HOT 11
- Getting java.util.NoSuchElementException on updateSite goal HOT 3
- Generated updatesite not working due to missing filters HOT 2
- Gradle 6 Incompatibility HOT 8
- extracting Bundle-License from pom.xml does not work HOT 1
- Not all bundles are downloaded HOT 2
- Default location of eclipseMirror no longer available HOT 7
- Add new releases to Gradle Plugin Portal HOT 1
- bndtools < 5.3 may create invalid ZIP file extra fields (jar loading exceptions with recent JRE versions) HOT 5
- Dependency Dashboard
- create eclipse plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bnd-platform.