lburgazzoli / gradle-karaf-plugin

Apache License 2.0
21 stars 13 forks source link

Disable automatic wrapping for WAR projects #51

Closed rikaateabug closed 7 years ago

rikaateabug commented 7 years ago

I'm having some issues creating a working features.xml using the gradle configuration setup with a WAR project. The WAR project alone builds correctly, and an osgi friendly WAR is created that I can deploy in karaf.

However, when I add it to the features gradle file is produces the following: `mvn:com.project.blah/gradeWeb/2.1.0-SNAPSHOT

war:mvn:com.project.blah/gradeWeb/2.1.0-SNAPSHOT/war` (Or if the line `jar.enabled = false` is in the project's build.gradle) `wrap:mvn:com.project.blah/gradeWeb/2.1.0-SNAPSHOT war:mvn:com.project.blah/gradeWeb/2.1.0-SNAPSHOT/war` For both of these cases I just need to remove the first line and the project works. **Is there any way to recognize the bundle as a WAR file, or perhaps disable the automatic wrapping for the individual project?** In case it is useful, the relevant gradle files are included as follows; The features build.gradle: ``` configurations { myConfig } karaf { features { feature { configuration 'myConfig' } } } dependencies { myConfig project(':my-war-project') } ``` The build.grade for my-war-project: ``` apply from: "$root/gradle/includes/base.gradle" apply plugin: 'war' apply plugin: 'osgi' jar.enabled = false dependencies { providedCompile "javax.servlet:servlet-api:2.5" } war { manifest = osgiManifest { instruction 'Web-ContextPath', '/context-path' instruction 'Webapp-Context', '/context-path' instruction 'Bundle-ClassPath', '.;/WEB-INF/classes' classesDir = project.sourceSets.main.output.classesDir classpath = project.configurations.runtime } } ```
lburgazzoli commented 7 years ago

I'm a little busy at the moment, will have a look as soon as I have some free time

lburgazzoli commented 7 years ago

@rikaateabug

I'm unsure if what I did is the best way to fix this issue so it may change in the future but can you give a try to the latest snapshot available on sonatype oss ?

https://oss.sonatype.org/content/repositories/snapshots/com/github/lburgazzoli/gradle-karaf-plugin/0.0.48-SNAPSHOT/

rikaateabug commented 7 years ago

This fixed the issue thanks!

lburgazzoli commented 7 years ago

Version 0.0.48 has been released