You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Felix Meschberger <fm...@gmail.com> on 2010/10/20 07:59:50 UTC

Maven SCR Plugin and ANT

Hi all,

Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
automatically download task (and other) dependencies from the web. Yet,
for the Ant task to fully function, the QDox, ASM and our own SCR
Annotations library must be available to the task.

The easiest thing would be to just include the QDox, ASM and our own SCR
Annotations libraries inside the maven-scr-plugin JAR file.

What I am unsure about is, whether we should really include the
libraries with the standard maven-scr-plugin JAR file or whether we
should create anonther, Ant-specific, artifact.

>From my POV here are the pros an cons of integrating the libs with the
standard build:

   + easier build
   + resolves a build time dependency problem for maven too
     (the scr.annotations SNAPSHOT needs not be deployed because it
      is already included in the plugin)
   + no additional QDox and ASM downloads
   - bigger size of the JAR file
   - It would probably be impossible to upgrade the QDox or ASM
     dependency for the maven-scr-plugin in a per-plugin dependencies
     section

I currently tend to just include the libraries with the standard build.

WDYT ?

Regards
Felix

Re: Maven SCR Plugin and ANT

Posted by Felix Meschberger <fm...@gmail.com>.
Created FELIX-2669 to track these changes ...

Lets see where this gets us ;-)

Regards
Felix

On 20.10.2010 10:52, Felix Meschberger wrote:
> Hi Clement,
> 
> On 20.10.2010 09:54, clement escoffier wrote:
>> Hi Felix,
>>
>> It probably won't help you, 
> 
> To the contrary: This is quite an interesting approach, which I think we
> should consider.
> 
> In fact this would also allow be to properly separate the
> scr.annotations from the actual plugin code: Currently the plugin code
> contains dependencies to the scr.annotations.
> 
> By createing separate Maven modules I can ...
> 
>   * Create a core SCR support with just the Java 5 annotation
>     framework support
>   * Move the scr.annotation annotation support out of the Maven
>     plugin into the scr.annotation making scr.annotation a real
>     role model for implementing annotation extensions
>   * Modify the Maven plugin to use the SCR core support and
>     integrate the scr.annotation as a default annotation support
>   * Create an Ant Task module drawing from both core SCR support
>     and from scr.annotations.
> 
> Thanks a lot for the hint.
> 
> Regards
> Felix
> 
>> but I had the same issue when creating the iPOJO
>> Ant Task. For me the issue was for Xerces. The approach I used is kind of
>> strange but works. Instead of having one artifact for ant and maven... I
>> created three artifacts:
>> - a common one (iPOJO Manipulator) which do the work but propose stable a
>> front end.
>> - a maven plugin receiving Maven configuration and  configuring the
>> manipulator
>> - a ant task that do the same as the maven plugin. This artifact includes
>> Xerces.
>>
>> The advantage of this approach is that I can change the manipulator version
>> using Ant and Maven configuration (Ant task classpath and Maven plugin
>> dependency).
>>
>> Regards,
>>
>> Clement
>>
>> 2010/10/20 Felix Meschberger <fm...@gmail.com>
>>
>>> Hi all,
>>>
>>> Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
>>> Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
>>> automatically download task (and other) dependencies from the web. Yet,
>>> for the Ant task to fully function, the QDox, ASM and our own SCR
>>> Annotations library must be available to the task.
>>>
>>> The easiest thing would be to just include the QDox, ASM and our own SCR
>>> Annotations libraries inside the maven-scr-plugin JAR file.
>>>
>>> What I am unsure about is, whether we should really include the
>>> libraries with the standard maven-scr-plugin JAR file or whether we
>>> should create anonther, Ant-specific, artifact.
>>>
>>> From my POV here are the pros an cons of integrating the libs with the
>>> standard build:
>>>
>>>   + easier build
>>>   + resolves a build time dependency problem for maven too
>>>     (the scr.annotations SNAPSHOT needs not be deployed because it
>>>      is already included in the plugin)
>>>   + no additional QDox and ASM downloads
>>>   - bigger size of the JAR file
>>>   - It would probably be impossible to upgrade the QDox or ASM
>>>     dependency for the maven-scr-plugin in a per-plugin dependencies
>>>     section
>>>
>>> I currently tend to just include the libraries with the standard build.
>>>
>>> WDYT ?
>>>
>>> Regards
>>> Felix
>>>
>>

Re: Maven SCR Plugin and ANT

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Clement,

On 20.10.2010 09:54, clement escoffier wrote:
> Hi Felix,
> 
> It probably won't help you, 

To the contrary: This is quite an interesting approach, which I think we
should consider.

In fact this would also allow be to properly separate the
scr.annotations from the actual plugin code: Currently the plugin code
contains dependencies to the scr.annotations.

By createing separate Maven modules I can ...

  * Create a core SCR support with just the Java 5 annotation
    framework support
  * Move the scr.annotation annotation support out of the Maven
    plugin into the scr.annotation making scr.annotation a real
    role model for implementing annotation extensions
  * Modify the Maven plugin to use the SCR core support and
    integrate the scr.annotation as a default annotation support
  * Create an Ant Task module drawing from both core SCR support
    and from scr.annotations.

Thanks a lot for the hint.

Regards
Felix

> but I had the same issue when creating the iPOJO
> Ant Task. For me the issue was for Xerces. The approach I used is kind of
> strange but works. Instead of having one artifact for ant and maven... I
> created three artifacts:
> - a common one (iPOJO Manipulator) which do the work but propose stable a
> front end.
> - a maven plugin receiving Maven configuration and  configuring the
> manipulator
> - a ant task that do the same as the maven plugin. This artifact includes
> Xerces.
> 
> The advantage of this approach is that I can change the manipulator version
> using Ant and Maven configuration (Ant task classpath and Maven plugin
> dependency).
> 
> Regards,
> 
> Clement
> 
> 2010/10/20 Felix Meschberger <fm...@gmail.com>
> 
>> Hi all,
>>
>> Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
>> Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
>> automatically download task (and other) dependencies from the web. Yet,
>> for the Ant task to fully function, the QDox, ASM and our own SCR
>> Annotations library must be available to the task.
>>
>> The easiest thing would be to just include the QDox, ASM and our own SCR
>> Annotations libraries inside the maven-scr-plugin JAR file.
>>
>> What I am unsure about is, whether we should really include the
>> libraries with the standard maven-scr-plugin JAR file or whether we
>> should create anonther, Ant-specific, artifact.
>>
>> From my POV here are the pros an cons of integrating the libs with the
>> standard build:
>>
>>   + easier build
>>   + resolves a build time dependency problem for maven too
>>     (the scr.annotations SNAPSHOT needs not be deployed because it
>>      is already included in the plugin)
>>   + no additional QDox and ASM downloads
>>   - bigger size of the JAR file
>>   - It would probably be impossible to upgrade the QDox or ASM
>>     dependency for the maven-scr-plugin in a per-plugin dependencies
>>     section
>>
>> I currently tend to just include the libraries with the standard build.
>>
>> WDYT ?
>>
>> Regards
>> Felix
>>
> 

Re: Maven SCR Plugin and ANT

Posted by clement escoffier <cl...@gmail.com>.
Hi Felix,

It probably won't help you, but I had the same issue when creating the iPOJO
Ant Task. For me the issue was for Xerces. The approach I used is kind of
strange but works. Instead of having one artifact for ant and maven... I
created three artifacts:
- a common one (iPOJO Manipulator) which do the work but propose stable a
front end.
- a maven plugin receiving Maven configuration and  configuring the
manipulator
- a ant task that do the same as the maven plugin. This artifact includes
Xerces.

The advantage of this approach is that I can change the manipulator version
using Ant and Maven configuration (Ant task classpath and Maven plugin
dependency).

Regards,

Clement

2010/10/20 Felix Meschberger <fm...@gmail.com>

> Hi all,
>
> Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
> Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
> automatically download task (and other) dependencies from the web. Yet,
> for the Ant task to fully function, the QDox, ASM and our own SCR
> Annotations library must be available to the task.
>
> The easiest thing would be to just include the QDox, ASM and our own SCR
> Annotations libraries inside the maven-scr-plugin JAR file.
>
> What I am unsure about is, whether we should really include the
> libraries with the standard maven-scr-plugin JAR file or whether we
> should create anonther, Ant-specific, artifact.
>
> From my POV here are the pros an cons of integrating the libs with the
> standard build:
>
>   + easier build
>   + resolves a build time dependency problem for maven too
>     (the scr.annotations SNAPSHOT needs not be deployed because it
>      is already included in the plugin)
>   + no additional QDox and ASM downloads
>   - bigger size of the JAR file
>   - It would probably be impossible to upgrade the QDox or ASM
>     dependency for the maven-scr-plugin in a per-plugin dependencies
>     section
>
> I currently tend to just include the libraries with the standard build.
>
> WDYT ?
>
> Regards
> Felix
>

Re: Maven SCR Plugin and ANT

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 20.10.2010 15:59, Stuart McCulloch wrote:
> On 20 October 2010 06:59, Felix Meschberger <fm...@gmail.com> wrote:
> 
>> Hi all,
>>
>> Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
>> Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
>> automatically download task (and other) dependencies from the web.
> 
> 
> FYI, you could always use the built-in "get" task to download dependencies:
> 
>    http://ant.apache.org/manual/Tasks/get.html
> 
> not ideal, but it's what we use in the generated Ant script from the
> bundleplugin:
> 
> 
> http://svn.apache.org/repos/asf/felix/trunk/bundleplugin/src/main/resources/build.xml
> 
> this is used in the "bundle:ant" goal to generate an Ant build for your
> project

Ah right ! Thanks for the hint. Will keep that in mind ...

For now, I think about reorganizing along the lines pointed out by Clement.

Regards
Felix

> 
> Yet,
>> for the Ant task to fully function, the QDox, ASM and our own SCR
>> Annotations library must be available to the task.
>>
>> The easiest thing would be to just include the QDox, ASM and our own SCR
>> Annotations libraries inside the maven-scr-plugin JAR file.
>>
>> What I am unsure about is, whether we should really include the
>> libraries with the standard maven-scr-plugin JAR file or whether we
>> should create anonther, Ant-specific, artifact.
>>
>> From my POV here are the pros an cons of integrating the libs with the
>> standard build:
>>
>>   + easier build
>>   + resolves a build time dependency problem for maven too
>>     (the scr.annotations SNAPSHOT needs not be deployed because it
>>      is already included in the plugin)
>>   + no additional QDox and ASM downloads
>>   - bigger size of the JAR file
>>   - It would probably be impossible to upgrade the QDox or ASM
>>     dependency for the maven-scr-plugin in a per-plugin dependencies
>>     section
>>
>> I currently tend to just include the libraries with the standard build.
>>
>> WDYT ?
>>
>> Regards
>> Felix
>>
> 
> 
> 

Re: Maven SCR Plugin and ANT

Posted by Stuart McCulloch <mc...@gmail.com>.
On 20 October 2010 06:59, Felix Meschberger <fm...@gmail.com> wrote:

> Hi all,
>
> Working on FELIX-2642 I was able to get the Maven SCR Plugin also be an
> Ant Task. Unlike Maven, though, Ant is not out-of-the-box able to
> automatically download task (and other) dependencies from the web.


FYI, you could always use the built-in "get" task to download dependencies:

   http://ant.apache.org/manual/Tasks/get.html

not ideal, but it's what we use in the generated Ant script from the
bundleplugin:


http://svn.apache.org/repos/asf/felix/trunk/bundleplugin/src/main/resources/build.xml

this is used in the "bundle:ant" goal to generate an Ant build for your
project

Yet,
> for the Ant task to fully function, the QDox, ASM and our own SCR
> Annotations library must be available to the task.
>
> The easiest thing would be to just include the QDox, ASM and our own SCR
> Annotations libraries inside the maven-scr-plugin JAR file.
>
> What I am unsure about is, whether we should really include the
> libraries with the standard maven-scr-plugin JAR file or whether we
> should create anonther, Ant-specific, artifact.
>
> From my POV here are the pros an cons of integrating the libs with the
> standard build:
>
>   + easier build
>   + resolves a build time dependency problem for maven too
>     (the scr.annotations SNAPSHOT needs not be deployed because it
>      is already included in the plugin)
>   + no additional QDox and ASM downloads
>   - bigger size of the JAR file
>   - It would probably be impossible to upgrade the QDox or ASM
>     dependency for the maven-scr-plugin in a per-plugin dependencies
>     section
>
> I currently tend to just include the libraries with the standard build.
>
> WDYT ?
>
> Regards
> Felix
>



-- 
Cheers, Stuart