You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Nick Wilson <ni...@card.co.uk> on 2010/04/19 11:32:31 UTC

Maven + OBR API problem

I'm having a problem using Maven to build an EAR file for an application
that makes calls to the OBR API. What seems to be happening is that as
soon as I add the OBR API as a maven dependency...

 

            <dependency>

                  <groupId>org.apache.felix</groupId>

                  <artifactId>org.osgi.service.obr</artifactId>

                  <version>1.0.2</version>

            </dependency>

 

...maven automatically adds "org.osgi.core-1.0.1.jar" to the EAR file.
My application then falls over when it tries to call Bundle.getVersion()
as that method isn't present in the 1.0 core API.

 

Why is Maven including that version of the core API? Is there some way I
can tell it not to?

 

Regards,

 

Nick

 


RE: Maven + OBR API problem

Posted by Nick Wilson <ni...@card.co.uk>.
> > Why is Maven including that version of the core API?
> Because it is listed as a dependency. Take a look at the pom
>
(http://repo2.maven.org/maven2/org/apache/felix/org.osgi.service.obr/1.0
.2/org.osgi.service.obr-1.0.2.pom)

> > Is there some way I
> > can tell it not to?
> Yes. See
>
http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-se
ct-conflict.html#ex-exclude


Thanks Justin, that explains it. Perhaps the OBR API pom file needs
updating though. Its manifest file imports version 1.3 of the framework
packages:

	Import-Package:
org.osgi.framework;version="1.3",org.osgi.service.obr;
	 version="1.0"

Regards,

Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Maven + OBR API problem

Posted by Justin Edelson <ju...@gmail.com>.
On 4/19/10 5:32 AM, Nick Wilson wrote:
> I'm having a problem using Maven to build an EAR file for an application
> that makes calls to the OBR API. What seems to be happening is that as
> soon as I add the OBR API as a maven dependency...
> 
>  
> 
>             <dependency>
> 
>                   <groupId>org.apache.felix</groupId>
> 
>                   <artifactId>org.osgi.service.obr</artifactId>
> 
>                   <version>1.0.2</version>
> 
>             </dependency>
> 
>  
> 
> ...maven automatically adds "org.osgi.core-1.0.1.jar" to the EAR file.
> My application then falls over when it tries to call Bundle.getVersion()
> as that method isn't present in the 1.0 core API.
> 
>  
> 
> Why is Maven including that version of the core API?
Because it is listed as a dependency. Take a look at the pom
(http://repo2.maven.org/maven2/org/apache/felix/org.osgi.service.obr/1.0.2/org.osgi.service.obr-1.0.2.pom)

> Is there some way I
> can tell it not to?
Yes. See
http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-conflict.html#ex-exclude

HTH,
Justin

> 
>  
> 
> Regards,
> 
>  
> 
> Nick
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org