Hi all,

I have come across an issue in carbon P2 plugin while creating a feature.
Please consider the following scenario. [1]

I need 2 jars to be bundled with the feature, from 2 different packages BUT
with the same artifact ID. Please see the highlighted text.

<plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <executions>
                    <execution>
                        <id>4-p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>org.wso2.carbon.analytics.spark.server</id>

<propertiesFile>../../../../etc/feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>

<propertyDef>org.wso2.carbon.p2.category.type:server
                                    </propertyDef>

<propertyDef>org.eclipse.equinox.p2.type.group:false
                                    </propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>

<bundleDef>org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.core</bundleDef>

<bundleDef>org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.admin</bundleDef>

<bundleDef>org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.utils</bundleDef>

<bundleDef>org.wso2.apache.spark:spark-core_2.10</bundleDef>

<bundleDef>org.wso2.apache.spark:spark-sql_2.10</bundleDef>

<bundleDef>org.apache.commons:commons-lang3</bundleDef>

<bundleDef>org.apache.commons:commons-math3</bundleDef>

<bundleDef>org.scala-lang:scala-library</bundleDef>

<bundleDef>org.scala-lang:scala-reflect</bundleDef>

<bundleDef>com.codahale.metrics:metrics-json</bundleDef>

<bundleDef>com.codahale.metrics:metrics-jvm</bundleDef>

<bundleDef>com.codahale.metrics:metrics-core</bundleDef>

<bundleDef>com.codahale.metrics:metrics-graphite</bundleDef>

<bundleDef>com.fasterxml.jackson.core:jackson-databind</bundleDef>

<bundleDef>com.fasterxml.jackson.core:jackson-core</bundleDef>

<bundleDef>com.fasterxml.jackson.core:jackson-annotations</bundleDef>

<bundleDef>com.esotericsoftware.kryo:kryo</bundleDef>

<bundleDef>org.xerial.snappy:snappy-java</bundleDef>

<bundleDef>io.netty.wso2:netty-all</bundleDef>

<bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef>

<bundleDef>org.apache.tomcat.wso2:tomcat-servlet-api</bundleDef>

<bundleDef>org.wso2.apache.hadoop:hadoop-client</bundleDef>

<bundleDef>org.wso2.json4s:json4s-jackson_2.10</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-continuation</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-http</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-io</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-jndi</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-security</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-server</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-servlet</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-util</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-webapp</bundleDef>

<bundleDef>org.eclipse.jetty:jetty-xml</bundleDef>
                                <bundleDef>io.netty:netty</bundleDef>

<bundleDef>org.spark-project.protobuf:protobuf-java</bundleDef>

 <bundleDef>com.google.protobuf:protobuf-java</bundleDef>


<bundleDef>org.wso2.uncommons.maths:uncommons-maths</bundleDef>
                                <bundleDef>com.ning:compress-lzf</bundleDef>

<bundleDef>com.google.guava:guava</bundleDef>
                                <bundleDef>org.slf4j:slf4j-api</bundleDef>

<bundleDef>org.slf4j:slf4j-log4j12</bundleDef>

<bundleDef>org.wso2.twitter:chill_2.10</bundleDef>

<bundleDef>org.wso2.clearspring.analytics:stream</bundleDef>

<bundleDef>org.wso2.orbit.org.apache.mesos:mesos</bundleDef>

                            </bundles>
                            <importFeatures>

<importFeatureDef>org.wso2.carbon.core:${carbon.kernel.version}
                                </importFeatureDef>
                            </importFeatures>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

After building the feature, I found the relevant jars in the feature's
plugins folder.  BUT when I put the feature inside the product, only the
2nd jar (com.google.protobuf:protobuf-java) is copied to the product's
plugins folder.
further looking into the problem, I found out that feature's feature.xml
file does not contain the 1st jar (org.spark-project.protobuf:protobuf-java),
which I think explains why it was not copied to the product's plugins
folder.

Is this a known issue? does the carbon p2 plugin omits such packages when
it is creating the feature.xml file?

look forward for your assistance in this regard.

cheers

[1]
https://github.com/wso2/carbon-analytics/blob/master/features/analytics/analytics-processors/org.wso2.carbon.analytics.spark.server.feature/pom.xml

-- 
*Niranda Perera*
Software Engineer, WSO2 Inc.
Mobile: +94-71-554-8430
Twitter: @n1r44 <https://twitter.com/N1R44>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to