dev@glassfish.java.net

Re: OSGi bundle / hk2 inhabitant help needed...

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Wed, 24 Sep 2008 07:19:30 -0700

Thanks for the suggestion Sahoo. However, when I try this I get:

[WARNING] Include-Resource: overriding
META-INF/admingui/console-config.xml=src/main/resources/META-INF/admingui/console-config.xml,branding/upsellpe.inc=src/main/resources/branding/upsellpe.inc,branding/loginimage.inc=src/main/resources/branding/loginimage.inc,branding/upsellee.inc=src/main/resources/branding/upsellee.inc,branding/masthead.inc=src/main/resources/branding/masthead.inc,branding/loginbackground.inc=src/main/resources/branding/loginbackground.inc,customtheme.properties=src/main/resources/customtheme.properties
with META-INF/inhabitants/default=META-INF/inhabitants/default (add
{maven-resources} if you want to include the maven resources)
[ERROR] Error building bundle
org.glassfish.admingui:console-theme-plugin:hk2-jar:10.0-SNAPSHOT :
Input file does not exist: META-INF/inhabitants/default
[ERROR] Error(s) found in bundle configuration
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error(s) found in bundle configuration

If I look for that file:

% ls target/classes/META-INF/inhabitants/default
target/classes/META-INF/inhabitants/default

I'm going to try some other variations of that, let me know if you have
any other ideas. FYI, the pom.xml can be tested by putting the version
in this email into the v3/admingui/customtheme directory.

Thanks!

Ken

Sahoo wrote:
> Try adding an instruction like this in maven-bundle-plugin:
>
> <Include-Resource>META-INF/inhabitants/default=META-INF/inhabitants/default</Include-Resource>
>
>
> Thanks,
> Sahoo
>
> Ken Paulsen wrote:
>>
>>
>> I have a pom.xml file where I want to package one of the dependencies
>> inline, and include some additional files which happen to implment an
>> HK2 @Service. I have this almost working. The build works
>> correctly, and everything appears in the jar and manifest file
>> correctly... except the META-INF/inhabitants/default file that was
>> generated (and appears correctly in
>> target/classes/META-INF/inhabitants/default). I have wasted a couple
>> hours playing guess-and-check to find the magic combination or some
>> work-a-round. However, I the ease-of-use of maven has stumped me
>> again....
>>
>> How do I do fix my pom.xml to include this file? Note: if I remove
>> the "executions" section, I get the "inhabitants" file, however, I
>> don't get the embedded dependency in the jar file (or any of the
>> related MANIFEST.MF import/export entries). Below is the pom.xml file:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <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/maven-v4_0_0.xsd">
>> <modelVersion>4.0.0</modelVersion>
>> <parent>
>> <groupId>org.glassfish.admingui</groupId>
>> <artifactId>admingui</artifactId>
>> <version>10.0-SNAPSHOT</version>
>> </parent>
>> <artifactId>console-theme-plugin</artifactId>
>> <packaging>hk2-jar</packaging>
>> <name>Admin Console Custom Plugin</name>
>> <description>Custom Theme Plugin for Glassfish V3 Admin
>> Console</description>
>>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.felix</groupId>
>> <artifactId>maven-bundle-plugin</artifactId>
>> <configuration>
>> <supportedProjectTypes>
>>
>> <supportedProjectType>hk2-jar</supportedProjectType>
>> <supportedProjectType>jar</supportedProjectType>
>>
>> <supportedProjectType>bundle</supportedProjectType>
>> </supportedProjectTypes>
>> <instructions>
>>
>> <Embed-Dependency>*;artifactId=webui-jsf-suntheme;inline=true</Embed-Dependency>
>>
>>
>> <Export-Package>org.glassfish.admingui.customtheme.*</Export-Package>
>> <_exportcontents>*</_exportcontents>
>>
>> <X-SJWUIC-SWAED-Version>4.0</X-SJWUIC-SWAED-Version>
>>
>> <X-SJWUIC-Theme-Version>4.3</X-SJWUIC-Theme-Version>
>>
>> <X-SJWUIC-Theme-Timestamp>200807161313</X-SJWUIC-Theme-Timestamp>
>>
>> <X-SJWUIC-Theme-Name>suntheme</X-SJWUIC-Theme-Name>
>>
>> <X-SJWUIC-Theme-Prefix>/theme</X-SJWUIC-Theme-Prefix>
>>
>> <X-SJWUIC-Theme-Messages>woodstock4_3.suntheme.messages.messages</X-SJWUIC-Theme-Messages>
>>
>>
>> <X-SJWUIC-Theme-Images>woodstock4_3.suntheme.properties.images</X-SJWUIC-Theme-Images>
>>
>>
>> <X-SJWUIC-Theme-JavaScript>woodstock4_3.suntheme.properties.javascript</X-SJWUIC-Theme-JavaScript>
>>
>>
>> <X-SJWUIC-Theme-ClassMapper>woodstock4_3.suntheme.properties.styles</X-SJWUIC-Theme-ClassMapper>
>>
>>
>> <X-SJWUIC-Theme-Stylesheets>woodstock4_3.suntheme.properties.stylesheets</X-SJWUIC-Theme-Stylesheets>
>>
>>
>> <X-SJWUIC-Theme-Templates>woodstock4_3.suntheme.properties.templates</X-SJWUIC-Theme-Templates>
>>
>> </instructions>
>> </configuration>
>> <executions>
>> <execution>
>> <id>osgi-bundle</id>
>> <phase>package</phase>
>> <goals>
>> <goal>bundle</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>> <dependencies>
>> <dependency>
>> <groupId>org.glassfish.common</groupId>
>> <artifactId>glassfish-api</artifactId>
>> <version>${glassfish-api.version}</version>
>> </dependency>
>> <dependency>
>> <groupId>org.glassfish.admingui</groupId>
>> <artifactId>console-plugin-service</artifactId>
>> <version>${glassfish.version}</version>
>> </dependency>
>> <dependency>
>> <groupId>com.sun.woodstock</groupId>
>> <artifactId>webui-jsf-suntheme</artifactId>
>> <version>4.3.0.7</version>
>> <scope>compile</scope>
>> </dependency>
>> </dependencies>
>> </project>
>>
>> Thanks in advance!
>>
>> Ken
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net For
>> additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>