You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by motes motes <mo...@gmail.com> on 2010/08/20 17:32:48 UTC

Multiple build types for a submodule (bundle and artifact)?

Is it possible in a maven submodule pom file to specify that it should
build a normal artifact jar and a felix bundle during the packaging
phase?

It works fine for each case separately  (using the felix plugin for
the bundle case) but the problem is that the bundle version cannot be
used as a dependency in another pure maven module. Thats why I want to
build two versions of the module.

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


Re: Multiple build types for a submodule (bundle and artifact)?

Posted by Justin Edelson <ju...@gmail.com>.
No idea.

On Aug 20, 2010, at 5:14 PM, motes motes <mo...@gmail.com> wrote:

> Another thing. I have managed to build and deploy an eclipse PDE
> bundle to the free version of nexus (not the pro version with P2
> support) using maven3 with tycho. Would it be possible to apply the
> same trick (removing the type tag) after adding the bundle to a maven
> project and make it work?
> 
> 
> 
> On Fri, Aug 20, 2010 at 7:07 PM, motes motes <mo...@gmail.com> wrote:
>> On Fri, Aug 20, 2010 at 6:34 PM, Justin Edelson <ju...@gmail.com> wrote:
>>> On 8/20/10 12:29 PM, motes motes wrote:
>>>> On Fri, Aug 20, 2010 at 5:38 PM, Justin Edelson <ju...@gmail.com> wrote:
>>>>> On 8/20/10 11:32 AM, motes motes wrote:
>>>>>> Is it possible in a maven submodule pom file to specify that it should
>>>>>> build a normal artifact jar and a felix bundle during the packaging
>>>>>> phase?
>>>>> I don't think so, but it certainly is possible by setting a classifier.
>>>>> 
>>>>>> 
>>>>>> It works fine for each case separately  (using the felix plugin for
>>>>>> the bundle case) but the problem is that the bundle version cannot be
>>>>>> used as a dependency in another pure maven module.
>>>>> Why not?
>>>> 
>>>> I build the maven module using Felix with:
>>>> 
>>>> ...
>>>>  <packaging>bundle</packaging>
>>>> 
>>>> ...
>>>>    <build>
>>>>     <plugins>
>>>>         <plugin>
>>>>               <groupId>org.apache.felix</groupId>
>>>>               <artifactId>maven-bundle-plugin</artifactId>
>>>>               <version>1.4.0</version>
>>>>            <extensions>true</extensions>
>>>>            <configuration>
>>>>               <instructions>
>>>>                   <Bundle-SymbolicName>com.test.bob</Bundle-SymbolicName>
>>>>                   <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>>                   <Bundle-Version>${pom.version}</Bundle-Version>
>>>>                         <Export-Package>com.test.bob.*</Export-Package>
>>>>               </instructions>
>>>>            </configuration>
>>>>         </plugin>
>>>>     </plugins>
>>>>    </build>
>>>> 
>>>> now when I run "mvn install" (using maven3) from the command line  it
>>>> ends up in my .m2/repositories folder which is fine. But when I add it
>>>> though the dependency manager in eclipse in a pure maven project the
>>>> types in the bundle are not available.
>>> 
>>> Remove the bit from the consuming poms where it says "<type>bundle</type>"
>>> 
>> 
>> 
>> 
>> Perfect it works! Thanks!
>> 
>> 
>>> In order for a <type> of bundle to be used as a dependency, the
>>> maven-felix-plugin must be an extension in the downstream project.
>>> However, since a bundle is just a jar, if your downstream project
>>> doesn't care about OSGi, if you remove the type element, Maven will
>>> treat it like any other JAR file.
>>> 
>>> Justin
>>> 
>>>> 
>>>> I know this related to the m2eclipse plugin for eclipse but I would
>>>> like to be able to develop my applications in eclipse.
>>>> 
>>>> If I build it with:
>>>> 
>>>>  <packaging>jar</packaging>
>>>> 
>>>> but keep the Felix instructions it works fine in the maven project but
>>>> the bundle instructions are no longer present in the MANIFEST file
>>>> which I need when I use it as bundle in my PDE project.
>>> 
>>> It would be nice if m2eclipse checked to see if "bundle" was going to be
>>> recognized type in the project and, if not, skip the type element, but
>>> this is easy enough to work around.
>>> 
>>> Justin
>>> 
>>>> 
>>>> I guess I am missing something basic here?
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> 
>>>>>> Thats why I want to
>>>>>> build two versions of the module.
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>> 
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>> 
>>>>> 
>>> 
>>> 
>> 

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


Re: Multiple build types for a submodule (bundle and artifact)?

Posted by motes motes <mo...@gmail.com>.
On Fri, Aug 20, 2010 at 5:38 PM, Justin Edelson <ju...@gmail.com> wrote:
> On 8/20/10 11:32 AM, motes motes wrote:
>> Is it possible in a maven submodule pom file to specify that it should
>> build a normal artifact jar and a felix bundle during the packaging
>> phase?
> I don't think so, but it certainly is possible by setting a classifier.
>
>>
>> It works fine for each case separately  (using the felix plugin for
>> the bundle case) but the problem is that the bundle version cannot be
>> used as a dependency in another pure maven module.
> Why not?

I build the maven module using Felix with:

...
 <packaging>bundle</packaging>

...
   <build>
    <plugins>
        <plugin>
        	<groupId>org.apache.felix</groupId>
        	<artifactId>maven-bundle-plugin</artifactId>
        	<version>1.4.0</version>
           <extensions>true</extensions>
           <configuration>
              <instructions>
                  <Bundle-SymbolicName>com.test.bob</Bundle-SymbolicName>
                  <Bundle-Name>${pom.artifactId}</Bundle-Name>
                  <Bundle-Version>${pom.version}</Bundle-Version>
    			  <Export-Package>com.test.bob.*</Export-Package>
              </instructions>
           </configuration>
        </plugin>
    </plugins>
   </build>

now when I run "mvn install" (using maven3) from the command line  it
ends up in my .m2/repositories folder which is fine. But when I add it
though the dependency manager in eclipse in a pure maven project the
types in the bundle are not available.

I know this related to the m2eclipse plugin for eclipse but I would
like to be able to develop my applications in eclipse.

If I build it with:

 <packaging>jar</packaging>

but keep the Felix instructions it works fine in the maven project but
the bundle instructions are no longer present in the MANIFEST file
which I need when I use it as bundle in my PDE project.

I guess I am missing something basic here?







>
>> Thats why I want to
>> build two versions of the module.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

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


Re: Multiple build types for a submodule (bundle and artifact)?

Posted by Justin Edelson <ju...@gmail.com>.
On 8/20/10 11:32 AM, motes motes wrote:
> Is it possible in a maven submodule pom file to specify that it should
> build a normal artifact jar and a felix bundle during the packaging
> phase?
I don't think so, but it certainly is possible by setting a classifier.

> 
> It works fine for each case separately  (using the felix plugin for
> the bundle case) but the problem is that the bundle version cannot be
> used as a dependency in another pure maven module.
Why not?

> Thats why I want to
> build two versions of the module.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


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