title: How to disable karaf-maven-plugin 4 tight dependency constraint checks
body: <p>Currently I am moving from karaf 3.0.5 to the newest version 4.0.2, I do assembly my own karaf with the karaf-maven-plugin. This is how my pom looks like.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;my.own.group&lt;/groupId&gt;
      &lt;artifactId&gt;assemble&lt;/artifactId&gt;
      &lt;version&gt;1.14.0-SNAPSHOT&lt;/version&gt;
      &lt;relativePath&gt;..&lt;/relativePath&gt;
  &lt;/parent&gt;
  
  &lt;artifactId&gt;karaf-customize&lt;/artifactId&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;packaging&gt;karaf-assembly&lt;/packaging&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.karaf.features&lt;/groupId&gt;
          &lt;artifactId&gt;framework&lt;/artifactId&gt;
          &lt;version&gt;${karaf.version}&lt;/version&gt;
          &lt;type&gt;kar&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.karaf.features&lt;/groupId&gt;
          &lt;artifactId&gt;standard&lt;/artifactId&gt;
          &lt;classifier&gt;features&lt;/classifier&gt;
          &lt;version&gt;${karaf.version}&lt;/version&gt;
          &lt;type&gt;xml&lt;/type&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf.karaf&lt;/groupId&gt;
          &lt;artifactId&gt;apache-cxf&lt;/artifactId&gt;
          &lt;classifier&gt;features&lt;/classifier&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
          &lt;type&gt;xml&lt;/type&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.karaf.features&lt;/groupId&gt;
          &lt;artifactId&gt;enterprise&lt;/artifactId&gt;
          &lt;classifier&gt;features&lt;/classifier&gt;
          &lt;version&gt;${karaf.version}&lt;/version&gt;
          &lt;type&gt;xml&lt;/type&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;my.own.group&lt;/groupId&gt;
          &lt;artifactId&gt;kar-archive&lt;/artifactId&gt;
          &lt;version&gt;1.14.0-SNAPSHOT&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;my.own.group&lt;/groupId&gt;
          &lt;artifactId&gt;karaf-branding&lt;/artifactId&gt;
          &lt;version&gt;1.14.0-SNAPSHOT&lt;/version&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.alutam&lt;/groupId&gt;
          &lt;artifactId&gt;ziputils&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;wsdl4j&lt;/groupId&gt;
          &lt;artifactId&gt;wsdl4j&lt;/artifactId&gt;
          &lt;version&gt;1.6.3&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.karaf.tooling&lt;/groupId&gt;
              &lt;artifactId&gt;karaf-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${karaf.version}&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
              &lt;configuration&gt;
                  &lt;javase&gt;1.8&lt;/javase&gt;
                  &lt;bootFeatures&gt;
                      &lt;feature&gt;jasypt-encryption&lt;/feature&gt;
                      &lt;feature&gt;config&lt;/feature&gt;
                      &lt;feature&gt;standard&lt;/feature&gt;
                      &lt;feature&gt;region&lt;/feature&gt;
                      &lt;feature&gt;management&lt;/feature&gt;
                      &lt;feature&gt;bundle&lt;/feature&gt;
                      &lt;feature&gt;package&lt;/feature&gt;
                      &lt;feature&gt;kar&lt;/feature&gt;
                      &lt;feature&gt;ssh&lt;/feature&gt;
                      &lt;feature&gt;http&lt;/feature&gt;
                      &lt;feature&gt;cxf&lt;/feature&gt;
                      &lt;feature&gt;service-wrapper&lt;/feature&gt;
                      &lt;feature&gt;jdbc&lt;/feature&gt;
                      &lt;feature&gt;system&lt;/feature&gt;
                  &lt;/bootFeatures&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>With this configuration I do get the following error for several dependencies.</p>
  
  <pre><code>Caused by: org.osgi.framework.BundleException: Unsupported 'Bundle-ManifestVersion' value: 1
      at org.apache.karaf.features.internal.resolver.ResourceBuilder.doBuild(ResourceBuilder.java:88)
      at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:78)
  </code></pre>
  
  <p>I guess it happens within this <a href="https://svn.apache.org/repos/asf/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java" rel="nofollow noreferrer">parser</a>. The reason is some old <a href="https://stackoverflow.com/questions/1244226/mangen-adds-bundle-manifestversion-1-to-manifest-but-felix-doesnt-seem-to-a">third party</a> libraries have only <code>Bundle-ManifestVersion: 1</code> set within their manifest file.
  With karaf-maven-plugin 3.x this didn't matter at all. In contrast the karaf-maven-plugin 4.x fails with message above.
  The only way I know to fix this is either rebuild from source or <a href="https://www.assembla.com/wiki/show/escapek/Create_OSGi_bundle_from_regular_jar_archive" rel="nofollow noreferrer">repack</a> the hole jar again.</p>
  
  <p>Is there any other way like a configuration for the karaf-maven-plugin to disable this constraint check? Because it would be awful lot of work to get all of this bundles up an running, again.</p>