users@hk2.java.net

Re: Maven Plugin usage

From: John Wells <john.wells_at_oracle.com>
Date: Mon, 18 Feb 2013 09:17:31 -0500

I believe to use that properly you will need to have the packaging type
of the thing you are building changed to "hk2" (or something like that...).

Why are you not using the more recent versions of hk2, where you can use
the hk2-inhabitant-generator instead, without having to change the
packing type?

On 2/18/2013 7:28 AM, Thibaut DUTEIL wrote:
> Hi,
>
> I try to use hk2-maven-plugin v2.0.5 to generate an HK2 Log Handler
> (for Glassfish 3.1.2.2).
>
> I made a very simple Java Class :
>
> @Service
> @ContractProvided(Handler.class)
> @Scoped(Singleton.class)
> public class JPAHandlerServiceImpl extends Handler implements
> PostConstruct {
>
> // Methods Implementation
>
> }
>
> I try to use Maven to generate the Jar file with generated
> META-INF/services
>
> in my POM I add the plugin :
>
> <plugin>
> <groupId>org.glassfish.hk2</groupId>
> <artifactId>hk2-maven-plugin</artifactId>
> <version>2.0.5</version>
> <extensions>true</extensions>
> <configuration>
> <includes>
> <include>fr/**</include>
> </includes>
> </configuration>
> </plugin>
>
> and the dependency:
>
> <dependency>
> <groupId>org.glassfish.hk2</groupId>
> <artifactId>hk2-maven-plugin</artifactId>
> <version>2.0.5</version>
> <scope>compile</scope>
> </dependency>
>
>
> but there's nothing generated. In my jar I have my .class and a
> standard Manifest.MF
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: Apache Maven
> Built-By: H
> Build-Jdk: 1.7.0_09
>
>
> Have you got an idea ? a sample ? a reference ?
>
> Thanks for you help.
>
> --
> Cordialement/Best regards,
>
>
> Thibaut DUTEIL
> Courriel :tduteil_at_etceterum.fr <mailto:tduteil_at_etceterum.fr>
> Site : http://www.etceterum.fr <http://www.etceterum.fr/>