You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Rodrigo Madera <ro...@gmail.com> on 2007/09/24 09:39:26 UTC

Having problems with maven-bundle-plugin

Hello,

I'm having some troubles with the plugin.

In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html),
the plugin example doesn't specify a version:

...
<plugins>
   <plugin>
    <groupId>org.apache.felix</groupId>
     <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <instructions>
        <Export-Package>org.foo.myproject.api</Export-Package>
        <Private-Package>org.foo.myproject.*</Private-Package>
        <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator>
      </instructions>
    </configuration>
   </plugin>
</plugins>
...


Note that <version> is absent in the plugin section.

However, in my pom.xml if I don't explicitly specify a <version> tag for it,
it fails with:

    [INFO] Scanning for projects...
    [INFO]
------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO]
------------------------------------------------------------------------
    [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not exist
or no valid version could be found
    [INFO]
------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO]
------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
    [INFO] Final Memory: 1M/4M
    [INFO]
------------------------------------------------------------------------

Does anyone know why this is happening? If I specify the version it works,
but I figure that I shouldn't put it there.

I am also having other problems, but I will post later, if I can still not
figure it out with this version information.

Thank you,
Rodrigo

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Thanks, that saved some space on the child poms.

Now to the next (and hopefully last) problem:

If I set packaging=bundle, then one of the children fails saying that:

-- LISTING STARTS --

[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.acme:kernel:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.acme -DartifactId=kernel \
          -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file
there:       mvn deploy:deploy-file -DgroupId=com.acme -DartifactId=kernel \
          -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.acme:user:jar:1.0-SNAPSHOT
        2) com.acme:kernel:jar:1.0-SNAPSHOT

-- LISTING ENDS --

But if I set it back to JAR, then everything works fine and the OSGi bundles
get correctly created.

I could just leave it like this, but from the input I have from this list
this is not what would happen!!
The bundles should be built well with packaging=bundle.

My guess is that packaging=bundle is messing dependency resolution someway.

Thanks for helping me pinpoint this,
Rodrigo


On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Also, do you know how to make SCR run on every child without making it
> > explicit on every pom.xml?
> > Something I can add to the parent pom.xml?
>
>
> you could either add the following to the parent pom:
>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-scr-plugin</artifactId>
>         <version>0.3.0-SNAPSHOT</version>
>         <executions>
>           <execution>
>             <id>generate-scr-descriptor</id>
>             <goals>
>               <goal>scr</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>
> then every child pom would include this in it's build
>
> or you could add it to your centralized pluginManagement:
>
>     <pluginManagement>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-scr-plugin</artifactId>
>         <version>0.3.0-SNAPSHOT</version>
>         <executions>
>           <execution>
>             <id>generate-scr-descriptor</id>
>             <goals>
>               <goal>scr</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>     </pluginManagement>
>
> the difference being that only child poms that explicitly add the
> following
> would include the execution:
>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-scr-plugin</artifactId>
>       </plugin>
>
> the benefit of this approach is when you only want to enable certain
> plugins
> in some of the child poms
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Also, do you know how to make SCR run on every child without making it
> explicit on every pom.xml?
> Something I can add to the parent pom.xml?


you could either add the following to the parent pom:

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
        <version>0.3.0-SNAPSHOT</version>
        <executions>
          <execution>
            <id>generate-scr-descriptor</id>
            <goals>
              <goal>scr</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

then every child pom would include this in it's build

or you could add it to your centralized pluginManagement:

    <pluginManagement>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
        <version>0.3.0-SNAPSHOT</version>
        <executions>
          <execution>
            <id>generate-scr-descriptor</id>
            <goals>
              <goal>scr</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </pluginManagement>

the difference being that only child poms that explicitly add the following
would include the execution:

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
      </plugin>

the benefit of this approach is when you only want to enable certain plugins
in some of the child poms

-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Excellent Stuart, thanks a lot. It solved the problem nicely.

Now I only have the problem of needing explicit <executions> defined.

Also, do you know how to make SCR run on every child without making it
explicit on every pom.xml?
Something I can add to the parent pom.xml?

Thanks,
Rodrigo

On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Hello,
> >
> > I'm having some troubles with the plugin.
> >
> > In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html
> ),
> > the plugin example doesn't specify a version:
>
>
> true - but you don't always have to specify a version in maven
>
> for example, to _explicitly_ use a version of the plugin in a particular
> pom
> you would indeed use:
>
> <plugins>
>   <plugin>
>     <groupId>org.apache.felix</groupId>
>     <artifactId>maven-bundle-plugin</artifactId>
>     <version>1.0.0</version>
>     <!-- etc,,, -->
>
> but a lot of people put plugin versions inside a pluginManagement section
> in
> some central pom:
>
> <pluginManagement>
>   <plugins>
>     <plugin>
>       <groupId>org.apache.felix</groupId>
>       <artifactId>maven-bundle-plugin</artifactId>
>       <version>1.0.0</version>
>     </plugin>
>   </plugins>
> </pluginManagement>
>
> and get builds poms to inherit these versions by setting this pom as the
> parent (or grandparent, etc.)
> if you inherit a plugin version from pluginManagement then you don't need
> to
> set it in the build pom.
>
> similarly maven has a dependencyManagement section that works in the same
> way for dependencies
>
>    http://maven.apache.org/pom.html
>
> ...
> > <plugins>
> >    <plugin>
> >     <groupId>org.apache.felix</groupId>
> >      <artifactId>maven-bundle-plugin</artifactId>
> >     <extensions>true</extensions>
> >     <configuration>
> >       <instructions>
> >         <Export-Package>org.foo.myproject.api</Export-Package>
> >         <Private-Package>org.foo.myproject.*</Private-Package>
> >         <Bundle-Activator>org.foo.myproject.impl1.Activator
> > </Bundle-Activator>
> >       </instructions>
> >     </configuration>
> >    </plugin>
> > </plugins>
> > ...
> >
> >
> > Note that <version> is absent in the plugin section.
> >
> > However, in my pom.xml if I don't explicitly specify a <version> tag for
> > it,
> > it fails with:
> >
> >     [INFO] Scanning for projects...
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [ERROR] BUILD ERROR
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not
> > exist
> > or no valid version could be found
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] For more information, run Maven with the -e switch
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] Total time: < 1 second
> >     [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
> >     [INFO] Final Memory: 1M/4M
> >     [INFO]
> > ------------------------------------------------------------------------
> >
> > Does anyone know why this is happening? If I specify the version it
> works,
> > but I figure that I shouldn't put it there.
>
>
> if you only have a few build poms then you can put it there - but if you
> have a lot of build poms
> you might find it hard to maintain, keeping them all up-to-date. In that
> case you should use the
> pluginManagement approach mentioned above
>
> I am also having other problems, but I will post later, if I can still not
> > figure it out with this version information.
> >
> > Thank you,
> > Rodrigo
> >
>
>
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Hello,
>
> I'm having some troubles with the plugin.
>
> In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html),
> the plugin example doesn't specify a version:


true - but you don't always have to specify a version in maven

for example, to _explicitly_ use a version of the plugin in a particular pom
you would indeed use:

<plugins>
  <plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>1.0.0</version>
    <!-- etc,,, -->

but a lot of people put plugin versions inside a pluginManagement section in
some central pom:

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <version>1.0.0</version>
    </plugin>
  </plugins>
</pluginManagement>

and get builds poms to inherit these versions by setting this pom as the
parent (or grandparent, etc.)
if you inherit a plugin version from pluginManagement then you don't need to
set it in the build pom.

similarly maven has a dependencyManagement section that works in the same
way for dependencies

   http://maven.apache.org/pom.html

...
> <plugins>
>    <plugin>
>     <groupId>org.apache.felix</groupId>
>      <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <instructions>
>         <Export-Package>org.foo.myproject.api</Export-Package>
>         <Private-Package>org.foo.myproject.*</Private-Package>
>         <Bundle-Activator>org.foo.myproject.impl1.Activator
> </Bundle-Activator>
>       </instructions>
>     </configuration>
>    </plugin>
> </plugins>
> ...
>
>
> Note that <version> is absent in the plugin section.
>
> However, in my pom.xml if I don't explicitly specify a <version> tag for
> it,
> it fails with:
>
>     [INFO] Scanning for projects...
>     [INFO]
> ------------------------------------------------------------------------
>     [ERROR] BUILD ERROR
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not
> exist
> or no valid version could be found
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] For more information, run Maven with the -e switch
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] Total time: < 1 second
>     [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
>     [INFO] Final Memory: 1M/4M
>     [INFO]
> ------------------------------------------------------------------------
>
> Does anyone know why this is happening? If I specify the version it works,
> but I figure that I shouldn't put it there.


if you only have a few build poms then you can put it there - but if you
have a lot of build poms
you might find it hard to maintain, keeping them all up-to-date. In that
case you should use the
pluginManagement approach mentioned above

I am also having other problems, but I will post later, if I can still not
> figure it out with this version information.
>
> Thank you,
> Rodrigo
>



-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Well, I got it working...

I had to put the BND plugin into the Parent, along with the SCR plugin.
If the both are on the parent the children seem to get it right.

Maybe it makes sense after all...

Thank you for all your enormous support.
I am looking forward to give some tips once we mere mortals (to be read as:
"non-commiters") can post to the wiki,

Thanks!! =o)
Rodrigo

On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Ok, that's what I was worrying about.
> >
> > So I set everything up, and I notice that this keeps up:
> >
> > * Parent POM runs scr-plugin for all children.
> > * Child POM is configured as bundle.
> >
> > Scr-plugin still doesn't run.
>
>
> odd, it does for me locally - can you send me the parent and child poms?
>
> The only way to make the bastard run is to add this:
> >
> >                 <executions>
> >                     <execution>
> >                         <id>Packaging Bundle</id>
> >                         <phase>package</phase>
> >                         <goals>
> >                             <goal>bundle</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >
> > Inside the "maven-bundle-plugin" section (attention: to the BND section,
> > nothing to do with SCR).
> >
> > SCR was configured to run automatically, why is this needed?!?!?
>
>
> this should have nothing to do with SCR - it's a completely separate
> plugin
>
> The parent uses this to make children execute SCR:
> >
> >             <plugin>
> >                 <groupId>org.apache.felix</groupId>
> >                 <artifactId>maven-scr-plugin</artifactId>
> >                 <version>0.3.0-SNAPSHOT</version>
> >
> >                 <executions>
> >                     <execution>
> >                         <id>generate-scr-descriptor</id>
> >                         <phase>package</phase>
> >                         <goals>
> >                             <goal>scr</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions>
> >             </plugin>
> >
> > My head is spinning at this point... please enlighten me =P
>
>
> I'll need to see the actual poms to help - send a zip of them to my
> personal
> email
>
> Yours,
> > Rodrigo
> >
> >
> > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > >
> > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > >
> > > > Ok, but this doesn't mean that it will use the last installed
> package,
> > > > right?
> > > > This would generate a Chicken and the Egg problem.
> > >
> > >
> > > not sure what you mean - maven doesn't allow circular dependencies
> > >
> > > if you use 'mvn clean install' from the top then maven will order the
> > > reactor build to
> > > ensure that artifacts are installed in order of use - so the right
> > package
> > > will be used.
> > >
> > > Thanks,
> > > > Rodrigo
> > > >
> > > > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > > > >
> > > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > > > >
> > > > > > Excellent.
> > > > > >
> > > > > > Now the only obstacle is the dependency inability when
> > > > packaging=bundle.
> > > > >
> > > > >
> > > > > it's not really a dependency issue as such...
> > > > >
> > > > > with jar packaging, projects in your local reactor (ie. the
> current
> > > > build)
> > > > > are treated specially
> > > > > - for example, the compiler would use
> > > "dependentProject/target/classes"
> > > > > instead of the jar
> > > > > produced by dependentProject, because the content is the same
> > > > >
> > > > > however, when using BND the bundle can contain more classes (or
> > > > sometimes
> > > > > fewer) than
> > > > > what's under target/classes - so the bundleplugin will always use
> > the
> > > > > final
> > > > > build artifact
> > > > >
> > > > > unfortunately (because it's hard to get info out of the maven
> core)
> > it
> > > > > simply tries to access
> > > > > the artifact in your local repository, so if you haven't done 'mvn
> > > > > install'
> > > > > it will fail
> > > > >
> > > > > if you try running 'mvn clean install' from the top of your
> project
> > it
> > > > > should work...
> > > > >
> > > > > Thank you for so much help,
> > > > > > Rodrigo
> > > > > >
> > > > > > On 9/24/07, Stuart McCulloch <st...@jayway.net>
> wrote:
> > > > > > >
> > > > > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com>
> wrote:
> > > > > > > >
> > > > > > > > BTW: I am forced to add an <executions> section for the BND
> > > plugin
> > > > > > _AND_
> > > > > > > > for
> > > > > > > > SCR for it to work.
> > > > > > > > Is this what you would expect?
> > > > > > > >
> > > > > > > > Please let me know if there is some trick/tip to simplify
> this
> > > > setup
> > > > > > > > (children pom.xml's with BND+SCR).
> > > > > > >
> > > > > > >
> > > > > > > there's no trick: if you want to build a bundle plus the SCR
> > > > > > > pre-processing
> > > > > > > then
> > > > > > > set the packaging to be bundle, and add the scrplugin goal to
> > the
> > > > > > > executions.
> > > > > > >
> > > > > > > for example:
> > > > > > >
> > > > > > > <?xml version="1.0" encoding="UTF8"?>
> > > > > > > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > > > > > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > > > > > > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > > > > http://www.w3.org/2001/XMLSchema-instance">
> > > > > > >
> > > > > > >   <modelVersion>4.0.0</modelVersion>
> > > > > > >   <groupId>com.acme.example</groupId>
> > > > > > >   <artifactId>acme</artifactId>
> > > > > > >   <version>1.0-SNAPSHOT</version>
> > > > > > >
> > > > > > >   <packaging>bundle</packaging>
> > > > > > >
> > > > > > >   <build>
> > > > > > >     <plugins>
> > > > > > >       <plugin>
> > > > > > >         <groupId>org.apache.felix</groupId>
> > > > > > >         <artifactId>maven-bundle-plugin</artifactId>
> > > > > > >         <version>1.1.0-SNAPSHOT</version>
> > > > > > >         <extensions>true</extensions>
> > > > > > >         <configuration>
> > > > > > >           <instructions>
> > > > > > >             <Export-Package>com.acme.*</Export-Package>
> > > > > > >           </instructions>
> > > > > > >         </configuration>
> > > > > > >       </plugin>
> > > > > > >       <plugin>
> > > > > > >         <groupId>org.apache.felix</groupId>
> > > > > > >         <artifactId>maven-scr-plugin</artifactId>
> > > > > > >         <version>0.3.0-SNAPSHOT</version>
> > > > > > >         <executions>
> > > > > > >           <execution>
> > > > > > >             <id>generate-scr-descriptor</id>
> > > > > > >             <goals>
> > > > > > >               <goal>scr</goal>
> > > > > > >             </goals>
> > > > > > >           </execution>
> > > > > > >         </executions>
> > > > > > >       </plugin>
> > > > > > >     </plugins>
> > > > > > >   </build>
> > > > > > >
> > > > > > > </project>
> > > > > > >
> > > > > > > you shouldn't need to add the bundle goal to the execution
> list.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > > Rodrigo
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Cheers, Stuart
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Cheers, Stuart
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Cheers, Stuart
> > >
> >
>
>
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Ok, that's what I was worrying about.
>
> So I set everything up, and I notice that this keeps up:
>
> * Parent POM runs scr-plugin for all children.
> * Child POM is configured as bundle.
>
> Scr-plugin still doesn't run.


odd, it does for me locally - can you send me the parent and child poms?

The only way to make the bastard run is to add this:
>
>                 <executions>
>                     <execution>
>                         <id>Packaging Bundle</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>
> Inside the "maven-bundle-plugin" section (attention: to the BND section,
> nothing to do with SCR).
>
> SCR was configured to run automatically, why is this needed?!?!?


this should have nothing to do with SCR - it's a completely separate plugin

The parent uses this to make children execute SCR:
>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-scr-plugin</artifactId>
>                 <version>0.3.0-SNAPSHOT</version>
>
>                 <executions>
>                     <execution>
>                         <id>generate-scr-descriptor</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>scr</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>
> My head is spinning at this point... please enlighten me =P


I'll need to see the actual poms to help - send a zip of them to my personal
email

Yours,
> Rodrigo
>
>
> On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > >
> > > Ok, but this doesn't mean that it will use the last installed package,
> > > right?
> > > This would generate a Chicken and the Egg problem.
> >
> >
> > not sure what you mean - maven doesn't allow circular dependencies
> >
> > if you use 'mvn clean install' from the top then maven will order the
> > reactor build to
> > ensure that artifacts are installed in order of use - so the right
> package
> > will be used.
> >
> > Thanks,
> > > Rodrigo
> > >
> > > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > > >
> > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > > >
> > > > > Excellent.
> > > > >
> > > > > Now the only obstacle is the dependency inability when
> > > packaging=bundle.
> > > >
> > > >
> > > > it's not really a dependency issue as such...
> > > >
> > > > with jar packaging, projects in your local reactor (ie. the current
> > > build)
> > > > are treated specially
> > > > - for example, the compiler would use
> > "dependentProject/target/classes"
> > > > instead of the jar
> > > > produced by dependentProject, because the content is the same
> > > >
> > > > however, when using BND the bundle can contain more classes (or
> > > sometimes
> > > > fewer) than
> > > > what's under target/classes - so the bundleplugin will always use
> the
> > > > final
> > > > build artifact
> > > >
> > > > unfortunately (because it's hard to get info out of the maven core)
> it
> > > > simply tries to access
> > > > the artifact in your local repository, so if you haven't done 'mvn
> > > > install'
> > > > it will fail
> > > >
> > > > if you try running 'mvn clean install' from the top of your project
> it
> > > > should work...
> > > >
> > > > Thank you for so much help,
> > > > > Rodrigo
> > > > >
> > > > > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > > > > >
> > > > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > > > > >
> > > > > > > BTW: I am forced to add an <executions> section for the BND
> > plugin
> > > > > _AND_
> > > > > > > for
> > > > > > > SCR for it to work.
> > > > > > > Is this what you would expect?
> > > > > > >
> > > > > > > Please let me know if there is some trick/tip to simplify this
> > > setup
> > > > > > > (children pom.xml's with BND+SCR).
> > > > > >
> > > > > >
> > > > > > there's no trick: if you want to build a bundle plus the SCR
> > > > > > pre-processing
> > > > > > then
> > > > > > set the packaging to be bundle, and add the scrplugin goal to
> the
> > > > > > executions.
> > > > > >
> > > > > > for example:
> > > > > >
> > > > > > <?xml version="1.0" encoding="UTF8"?>
> > > > > > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > > > > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > > > > > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > > > http://www.w3.org/2001/XMLSchema-instance">
> > > > > >
> > > > > >   <modelVersion>4.0.0</modelVersion>
> > > > > >   <groupId>com.acme.example</groupId>
> > > > > >   <artifactId>acme</artifactId>
> > > > > >   <version>1.0-SNAPSHOT</version>
> > > > > >
> > > > > >   <packaging>bundle</packaging>
> > > > > >
> > > > > >   <build>
> > > > > >     <plugins>
> > > > > >       <plugin>
> > > > > >         <groupId>org.apache.felix</groupId>
> > > > > >         <artifactId>maven-bundle-plugin</artifactId>
> > > > > >         <version>1.1.0-SNAPSHOT</version>
> > > > > >         <extensions>true</extensions>
> > > > > >         <configuration>
> > > > > >           <instructions>
> > > > > >             <Export-Package>com.acme.*</Export-Package>
> > > > > >           </instructions>
> > > > > >         </configuration>
> > > > > >       </plugin>
> > > > > >       <plugin>
> > > > > >         <groupId>org.apache.felix</groupId>
> > > > > >         <artifactId>maven-scr-plugin</artifactId>
> > > > > >         <version>0.3.0-SNAPSHOT</version>
> > > > > >         <executions>
> > > > > >           <execution>
> > > > > >             <id>generate-scr-descriptor</id>
> > > > > >             <goals>
> > > > > >               <goal>scr</goal>
> > > > > >             </goals>
> > > > > >           </execution>
> > > > > >         </executions>
> > > > > >       </plugin>
> > > > > >     </plugins>
> > > > > >   </build>
> > > > > >
> > > > > > </project>
> > > > > >
> > > > > > you shouldn't need to add the bundle goal to the execution list.
> > > > > >
> > > > > > Thanks,
> > > > > > > Rodrigo
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Cheers, Stuart
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Cheers, Stuart
> > > >
> > >
> >
> >
> >
> > --
> > Cheers, Stuart
> >
>



-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Ok, that's what I was worrying about.

So I set everything up, and I notice that this keeps up:

* Parent POM runs scr-plugin for all children.
* Child POM is configured as bundle.

Scr-plugin still doesn't run.

The only way to make the bastard run is to add this:

                <executions>
                    <execution>
                        <id>Packaging Bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>

Inside the "maven-bundle-plugin" section (attention: to the BND section,
nothing to do with SCR).

SCR was configured to run automatically, why is this needed?!?!?

The parent uses this to make children execute SCR:

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <version>0.3.0-SNAPSHOT</version>

                <executions>
                    <execution>
                        <id>generate-scr-descriptor</id>
                        <phase>package</phase>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

My head is spinning at this point... please enlighten me =P

Yours,
Rodrigo


On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Ok, but this doesn't mean that it will use the last installed package,
> > right?
> > This would generate a Chicken and the Egg problem.
>
>
> not sure what you mean - maven doesn't allow circular dependencies
>
> if you use 'mvn clean install' from the top then maven will order the
> reactor build to
> ensure that artifacts are installed in order of use - so the right package
> will be used.
>
> Thanks,
> > Rodrigo
> >
> > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > >
> > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > >
> > > > Excellent.
> > > >
> > > > Now the only obstacle is the dependency inability when
> > packaging=bundle.
> > >
> > >
> > > it's not really a dependency issue as such...
> > >
> > > with jar packaging, projects in your local reactor (ie. the current
> > build)
> > > are treated specially
> > > - for example, the compiler would use
> "dependentProject/target/classes"
> > > instead of the jar
> > > produced by dependentProject, because the content is the same
> > >
> > > however, when using BND the bundle can contain more classes (or
> > sometimes
> > > fewer) than
> > > what's under target/classes - so the bundleplugin will always use the
> > > final
> > > build artifact
> > >
> > > unfortunately (because it's hard to get info out of the maven core) it
> > > simply tries to access
> > > the artifact in your local repository, so if you haven't done 'mvn
> > > install'
> > > it will fail
> > >
> > > if you try running 'mvn clean install' from the top of your project it
> > > should work...
> > >
> > > Thank you for so much help,
> > > > Rodrigo
> > > >
> > > > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > > > >
> > > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > > > >
> > > > > > BTW: I am forced to add an <executions> section for the BND
> plugin
> > > > _AND_
> > > > > > for
> > > > > > SCR for it to work.
> > > > > > Is this what you would expect?
> > > > > >
> > > > > > Please let me know if there is some trick/tip to simplify this
> > setup
> > > > > > (children pom.xml's with BND+SCR).
> > > > >
> > > > >
> > > > > there's no trick: if you want to build a bundle plus the SCR
> > > > > pre-processing
> > > > > then
> > > > > set the packaging to be bundle, and add the scrplugin goal to the
> > > > > executions.
> > > > >
> > > > > for example:
> > > > >
> > > > > <?xml version="1.0" encoding="UTF8"?>
> > > > > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > > > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > > > > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > > http://www.w3.org/2001/XMLSchema-instance">
> > > > >
> > > > >   <modelVersion>4.0.0</modelVersion>
> > > > >   <groupId>com.acme.example</groupId>
> > > > >   <artifactId>acme</artifactId>
> > > > >   <version>1.0-SNAPSHOT</version>
> > > > >
> > > > >   <packaging>bundle</packaging>
> > > > >
> > > > >   <build>
> > > > >     <plugins>
> > > > >       <plugin>
> > > > >         <groupId>org.apache.felix</groupId>
> > > > >         <artifactId>maven-bundle-plugin</artifactId>
> > > > >         <version>1.1.0-SNAPSHOT</version>
> > > > >         <extensions>true</extensions>
> > > > >         <configuration>
> > > > >           <instructions>
> > > > >             <Export-Package>com.acme.*</Export-Package>
> > > > >           </instructions>
> > > > >         </configuration>
> > > > >       </plugin>
> > > > >       <plugin>
> > > > >         <groupId>org.apache.felix</groupId>
> > > > >         <artifactId>maven-scr-plugin</artifactId>
> > > > >         <version>0.3.0-SNAPSHOT</version>
> > > > >         <executions>
> > > > >           <execution>
> > > > >             <id>generate-scr-descriptor</id>
> > > > >             <goals>
> > > > >               <goal>scr</goal>
> > > > >             </goals>
> > > > >           </execution>
> > > > >         </executions>
> > > > >       </plugin>
> > > > >     </plugins>
> > > > >   </build>
> > > > >
> > > > > </project>
> > > > >
> > > > > you shouldn't need to add the bundle goal to the execution list.
> > > > >
> > > > > Thanks,
> > > > > > Rodrigo
> > > > > >
> > > > >
> > > > > --
> > > > > Cheers, Stuart
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Cheers, Stuart
> > >
> >
>
>
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Ok, but this doesn't mean that it will use the last installed package,
> right?
> This would generate a Chicken and the Egg problem.


not sure what you mean - maven doesn't allow circular dependencies

if you use 'mvn clean install' from the top then maven will order the
reactor build to
ensure that artifacts are installed in order of use - so the right package
will be used.

Thanks,
> Rodrigo
>
> On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > >
> > > Excellent.
> > >
> > > Now the only obstacle is the dependency inability when
> packaging=bundle.
> >
> >
> > it's not really a dependency issue as such...
> >
> > with jar packaging, projects in your local reactor (ie. the current
> build)
> > are treated specially
> > - for example, the compiler would use "dependentProject/target/classes"
> > instead of the jar
> > produced by dependentProject, because the content is the same
> >
> > however, when using BND the bundle can contain more classes (or
> sometimes
> > fewer) than
> > what's under target/classes - so the bundleplugin will always use the
> > final
> > build artifact
> >
> > unfortunately (because it's hard to get info out of the maven core) it
> > simply tries to access
> > the artifact in your local repository, so if you haven't done 'mvn
> > install'
> > it will fail
> >
> > if you try running 'mvn clean install' from the top of your project it
> > should work...
> >
> > Thank you for so much help,
> > > Rodrigo
> > >
> > > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > > >
> > > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > > >
> > > > > BTW: I am forced to add an <executions> section for the BND plugin
> > > _AND_
> > > > > for
> > > > > SCR for it to work.
> > > > > Is this what you would expect?
> > > > >
> > > > > Please let me know if there is some trick/tip to simplify this
> setup
> > > > > (children pom.xml's with BND+SCR).
> > > >
> > > >
> > > > there's no trick: if you want to build a bundle plus the SCR
> > > > pre-processing
> > > > then
> > > > set the packaging to be bundle, and add the scrplugin goal to the
> > > > executions.
> > > >
> > > > for example:
> > > >
> > > > <?xml version="1.0" encoding="UTF8"?>
> > > > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > > > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > http://www.w3.org/2001/XMLSchema-instance">
> > > >
> > > >   <modelVersion>4.0.0</modelVersion>
> > > >   <groupId>com.acme.example</groupId>
> > > >   <artifactId>acme</artifactId>
> > > >   <version>1.0-SNAPSHOT</version>
> > > >
> > > >   <packaging>bundle</packaging>
> > > >
> > > >   <build>
> > > >     <plugins>
> > > >       <plugin>
> > > >         <groupId>org.apache.felix</groupId>
> > > >         <artifactId>maven-bundle-plugin</artifactId>
> > > >         <version>1.1.0-SNAPSHOT</version>
> > > >         <extensions>true</extensions>
> > > >         <configuration>
> > > >           <instructions>
> > > >             <Export-Package>com.acme.*</Export-Package>
> > > >           </instructions>
> > > >         </configuration>
> > > >       </plugin>
> > > >       <plugin>
> > > >         <groupId>org.apache.felix</groupId>
> > > >         <artifactId>maven-scr-plugin</artifactId>
> > > >         <version>0.3.0-SNAPSHOT</version>
> > > >         <executions>
> > > >           <execution>
> > > >             <id>generate-scr-descriptor</id>
> > > >             <goals>
> > > >               <goal>scr</goal>
> > > >             </goals>
> > > >           </execution>
> > > >         </executions>
> > > >       </plugin>
> > > >     </plugins>
> > > >   </build>
> > > >
> > > > </project>
> > > >
> > > > you shouldn't need to add the bundle goal to the execution list.
> > > >
> > > > Thanks,
> > > > > Rodrigo
> > > > >
> > > >
> > > > --
> > > > Cheers, Stuart
> > > >
> > >
> >
> >
> >
> > --
> > Cheers, Stuart
> >
>



-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Ok, but this doesn't mean that it will use the last installed package,
right?
This would generate a Chicken and the Egg problem.

Thanks,
Rodrigo

On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Excellent.
> >
> > Now the only obstacle is the dependency inability when packaging=bundle.
>
>
> it's not really a dependency issue as such...
>
> with jar packaging, projects in your local reactor (ie. the current build)
> are treated specially
> - for example, the compiler would use "dependentProject/target/classes"
> instead of the jar
> produced by dependentProject, because the content is the same
>
> however, when using BND the bundle can contain more classes (or sometimes
> fewer) than
> what's under target/classes - so the bundleplugin will always use the
> final
> build artifact
>
> unfortunately (because it's hard to get info out of the maven core) it
> simply tries to access
> the artifact in your local repository, so if you haven't done 'mvn
> install'
> it will fail
>
> if you try running 'mvn clean install' from the top of your project it
> should work...
>
> Thank you for so much help,
> > Rodrigo
> >
> > On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> > >
> > > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > > >
> > > > BTW: I am forced to add an <executions> section for the BND plugin
> > _AND_
> > > > for
> > > > SCR for it to work.
> > > > Is this what you would expect?
> > > >
> > > > Please let me know if there is some trick/tip to simplify this setup
> > > > (children pom.xml's with BND+SCR).
> > >
> > >
> > > there's no trick: if you want to build a bundle plus the SCR
> > > pre-processing
> > > then
> > > set the packaging to be bundle, and add the scrplugin goal to the
> > > executions.
> > >
> > > for example:
> > >
> > > <?xml version="1.0" encoding="UTF8"?>
> > > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > http://www.w3.org/2001/XMLSchema-instance">
> > >
> > >   <modelVersion>4.0.0</modelVersion>
> > >   <groupId>com.acme.example</groupId>
> > >   <artifactId>acme</artifactId>
> > >   <version>1.0-SNAPSHOT</version>
> > >
> > >   <packaging>bundle</packaging>
> > >
> > >   <build>
> > >     <plugins>
> > >       <plugin>
> > >         <groupId>org.apache.felix</groupId>
> > >         <artifactId>maven-bundle-plugin</artifactId>
> > >         <version>1.1.0-SNAPSHOT</version>
> > >         <extensions>true</extensions>
> > >         <configuration>
> > >           <instructions>
> > >             <Export-Package>com.acme.*</Export-Package>
> > >           </instructions>
> > >         </configuration>
> > >       </plugin>
> > >       <plugin>
> > >         <groupId>org.apache.felix</groupId>
> > >         <artifactId>maven-scr-plugin</artifactId>
> > >         <version>0.3.0-SNAPSHOT</version>
> > >         <executions>
> > >           <execution>
> > >             <id>generate-scr-descriptor</id>
> > >             <goals>
> > >               <goal>scr</goal>
> > >             </goals>
> > >           </execution>
> > >         </executions>
> > >       </plugin>
> > >     </plugins>
> > >   </build>
> > >
> > > </project>
> > >
> > > you shouldn't need to add the bundle goal to the execution list.
> > >
> > > Thanks,
> > > > Rodrigo
> > > >
> > >
> > > --
> > > Cheers, Stuart
> > >
> >
>
>
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Excellent.
>
> Now the only obstacle is the dependency inability when packaging=bundle.


it's not really a dependency issue as such...

with jar packaging, projects in your local reactor (ie. the current build)
are treated specially
- for example, the compiler would use "dependentProject/target/classes"
instead of the jar
produced by dependentProject, because the content is the same

however, when using BND the bundle can contain more classes (or sometimes
fewer) than
what's under target/classes - so the bundleplugin will always use the final
build artifact

unfortunately (because it's hard to get info out of the maven core) it
simply tries to access
the artifact in your local repository, so if you haven't done 'mvn install'
it will fail

if you try running 'mvn clean install' from the top of your project it
should work...

Thank you for so much help,
> Rodrigo
>
> On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> > >
> > > BTW: I am forced to add an <executions> section for the BND plugin
> _AND_
> > > for
> > > SCR for it to work.
> > > Is this what you would expect?
> > >
> > > Please let me know if there is some trick/tip to simplify this setup
> > > (children pom.xml's with BND+SCR).
> >
> >
> > there's no trick: if you want to build a bundle plus the SCR
> > pre-processing
> > then
> > set the packaging to be bundle, and add the scrplugin goal to the
> > executions.
> >
> > for example:
> >
> > <?xml version="1.0" encoding="UTF8"?>
> > <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> > http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance">
> >
> >   <modelVersion>4.0.0</modelVersion>
> >   <groupId>com.acme.example</groupId>
> >   <artifactId>acme</artifactId>
> >   <version>1.0-SNAPSHOT</version>
> >
> >   <packaging>bundle</packaging>
> >
> >   <build>
> >     <plugins>
> >       <plugin>
> >         <groupId>org.apache.felix</groupId>
> >         <artifactId>maven-bundle-plugin</artifactId>
> >         <version>1.1.0-SNAPSHOT</version>
> >         <extensions>true</extensions>
> >         <configuration>
> >           <instructions>
> >             <Export-Package>com.acme.*</Export-Package>
> >           </instructions>
> >         </configuration>
> >       </plugin>
> >       <plugin>
> >         <groupId>org.apache.felix</groupId>
> >         <artifactId>maven-scr-plugin</artifactId>
> >         <version>0.3.0-SNAPSHOT</version>
> >         <executions>
> >           <execution>
> >             <id>generate-scr-descriptor</id>
> >             <goals>
> >               <goal>scr</goal>
> >             </goals>
> >           </execution>
> >         </executions>
> >       </plugin>
> >     </plugins>
> >   </build>
> >
> > </project>
> >
> > you shouldn't need to add the bundle goal to the execution list.
> >
> > Thanks,
> > > Rodrigo
> > >
> >
> > --
> > Cheers, Stuart
> >
>



-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Excellent.

Now the only obstacle is the dependency inability when packaging=bundle.

Thank you for so much help,
Rodrigo

On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > BTW: I am forced to add an <executions> section for the BND plugin _AND_
> > for
> > SCR for it to work.
> > Is this what you would expect?
> >
> > Please let me know if there is some trick/tip to simplify this setup
> > (children pom.xml's with BND+SCR).
>
>
> there's no trick: if you want to build a bundle plus the SCR
> pre-processing
> then
> set the packaging to be bundle, and add the scrplugin goal to the
> executions.
>
> for example:
>
> <?xml version="1.0" encoding="UTF8"?>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
> http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance">
>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.acme.example</groupId>
>   <artifactId>acme</artifactId>
>   <version>1.0-SNAPSHOT</version>
>
>   <packaging>bundle</packaging>
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <version>1.1.0-SNAPSHOT</version>
>         <extensions>true</extensions>
>         <configuration>
>           <instructions>
>             <Export-Package>com.acme.*</Export-Package>
>           </instructions>
>         </configuration>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-scr-plugin</artifactId>
>         <version>0.3.0-SNAPSHOT</version>
>         <executions>
>           <execution>
>             <id>generate-scr-descriptor</id>
>             <goals>
>               <goal>scr</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>
> </project>
>
> you shouldn't need to add the bundle goal to the execution list.
>
> Thanks,
> > Rodrigo
> >
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> BTW: I am forced to add an <executions> section for the BND plugin _AND_
> for
> SCR for it to work.
> Is this what you would expect?
>
> Please let me know if there is some trick/tip to simplify this setup
> (children pom.xml's with BND+SCR).


there's no trick: if you want to build a bundle plus the SCR pre-processing
then
set the packaging to be bundle, and add the scrplugin goal to the
executions.

for example:

<?xml version="1.0" encoding="UTF8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd" xmlns="
http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.acme.example</groupId>
  <artifactId>acme</artifactId>
  <version>1.0-SNAPSHOT</version>

  <packaging>bundle</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.1.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>com.acme.*</Export-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
        <version>0.3.0-SNAPSHOT</version>
        <executions>
          <execution>
            <id>generate-scr-descriptor</id>
            <goals>
              <goal>scr</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>

you shouldn't need to add the bundle goal to the execution list.

Thanks,
> Rodrigo
>

-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
BTW: I am forced to add an <executions> section for the BND plugin _AND_ for
SCR for it to work.
Is this what you would expect?

Please let me know if there is some trick/tip to simplify this setup
(children pom.xml's with BND+SCR).

Thanks,
Rodrigo

On 9/24/07, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
> >
> > Ok thanks, but also regarding the plugin, check this piece of code:
> >
> >             <plugin>
> >                 <groupId>org.apache.felix</groupId>
> >                 <artifactId>maven-bundle-plugin</artifactId>
> >                 <version>1.1.0-SNAPSHOT</version>
> >
> >                 <extensions>true</extensions>
> >
> >                 <configuration>
> >                     <instructions>
> >                         <Export-Package>com.acme.*</Export-Package>
> >                     </instructions>
> >                 </configuration>
> >                 <!--executions>
> >                     <execution>
> >                         <id>Packaging Bundle</id>
> >                         <phase>package</phase>
> >                         <goals>
> >                             <goal>bundle</goal>
> >                         </goals>
> >                     </execution>
> >                 </executions-->
> >             </plugin>
> >
> > This pom has the packaging set to "bundle", and I also have a BND
> > configuration section (which I omitted for brevity).
> >
> > The problem is that if I comment out the <executions> section on this
> code
> > (the maven-bundle-plugin section) then the SCR plugin will not execute,
> > rendering me a useless JAR file that doesn't have the exported services
> on
> > the OSGI-INF directory.
> >
> > So basically, if I set packaging=bundle, it should be all automatic,
> both
> > BND + SCR, right?
>
>
> no - the bundle packaging does _not_ add the SCR plugin (see the
> components.xml link I sent in another email)
> the SCR plugin is an optional pre-processor (there are several such
> plugins
> in Felix) and as such is not included
> in the default bundle packaging
>
> Why am I being forced to set the <executions> tag?
>
>
> you only need to add executions for additional plugins like SCR, for a
> 'vanilla' bundle just use bundle packaging
>
> As always, thanks for any help,
> > Rodrigo
> >
> > On 9/24/07, Hampel, Michael <mi...@siemens.com> wrote:
> > >
> > >
> > > Hello,
> > >
> > > somewhere you have to specify the plugin version for Maven - if you
> > don't
> > > do it in
> > > A parent pom you have to put it in your project's pom file.
> > > The advantage to specify the version in a parent pom is that you will
> > > inherit the plugin version
> > > in all child projects.
> > >
> > > HTH,
> > >
> > > Michael
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Rodrigo Madera [mailto:rodrigo.madera@gmail.com]
> > > Gesendet: Montag, 24. September 2007 09:39
> > > An: users@felix.apache.org
> > > Betreff: Having problems with maven-bundle-plugin
> > >
> > > Hello,
> > >
> > > I'm having some troubles with the plugin.
> > >
> > > In this page (
> http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html
> > ),
> > > the plugin example doesn't specify a version:
> > >
> > > ...
> > > <plugins>
> > >    <plugin>
> > >     <groupId>org.apache.felix</groupId>
> > >      <artifactId>maven-bundle-plugin</artifactId>
> > >     <extensions>true</extensions>
> > >     <configuration>
> > >       <instructions>
> > >         <Export-Package>org.foo.myproject.api</Export-Package>
> > >         <Private-Package>org.foo.myproject.*</Private-Package>
> > >         <Bundle-Activator>org.foo.myproject.impl1.Activator
> > > </Bundle-Activator>
> > >       </instructions>
> > >     </configuration>
> > >    </plugin>
> > > </plugins>
> > > ...
> > >
> > >
> > > Note that <version> is absent in the plugin section.
> > >
> > > However, in my pom.xml if I don't explicitly specify a <version> tag
> for
> > > it,
> > > it fails with:
> > >
> > >     [INFO] Scanning for projects...
> > >     [INFO]
> > >
> ------------------------------------------------------------------------
> > >     [ERROR] BUILD ERROR
> > >     [INFO]
> > >
> ------------------------------------------------------------------------
> > >     [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not
> > > exist
> > > or no valid version could be found
> > >     [INFO]
> > >
> ------------------------------------------------------------------------
> > >     [INFO] For more information, run Maven with the -e switch
> > >     [INFO]
> > >
> ------------------------------------------------------------------------
> > >     [INFO] Total time: < 1 second
> > >     [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
> > >     [INFO] Final Memory: 1M/4M
> > >     [INFO]
> > >
> ------------------------------------------------------------------------
> > >
> > > Does anyone know why this is happening? If I specify the version it
> > works,
> > > but I figure that I shouldn't put it there.
> > >
> > > I am also having other problems, but I will post later, if I can still
> > not
> > > figure it out with this version information.
> > >
> > > Thank you,
> > > Rodrigo
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
>
>
>
> --
> Cheers, Stuart
>

Re: Having problems with maven-bundle-plugin

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, Rodrigo Madera <ro...@gmail.com> wrote:
>
> Ok thanks, but also regarding the plugin, check this piece of code:
>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                 <version>1.1.0-SNAPSHOT</version>
>
>                 <extensions>true</extensions>
>
>                 <configuration>
>                     <instructions>
>                         <Export-Package>com.acme.*</Export-Package>
>                     </instructions>
>                 </configuration>
>                 <!--executions>
>                     <execution>
>                         <id>Packaging Bundle</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>bundle</goal>
>                         </goals>
>                     </execution>
>                 </executions-->
>             </plugin>
>
> This pom has the packaging set to "bundle", and I also have a BND
> configuration section (which I omitted for brevity).
>
> The problem is that if I comment out the <executions> section on this code
> (the maven-bundle-plugin section) then the SCR plugin will not execute,
> rendering me a useless JAR file that doesn't have the exported services on
> the OSGI-INF directory.
>
> So basically, if I set packaging=bundle, it should be all automatic, both
> BND + SCR, right?


no - the bundle packaging does _not_ add the SCR plugin (see the
components.xml link I sent in another email)
the SCR plugin is an optional pre-processor (there are several such plugins
in Felix) and as such is not included
in the default bundle packaging

Why am I being forced to set the <executions> tag?


you only need to add executions for additional plugins like SCR, for a
'vanilla' bundle just use bundle packaging

As always, thanks for any help,
> Rodrigo
>
> On 9/24/07, Hampel, Michael <mi...@siemens.com> wrote:
> >
> >
> > Hello,
> >
> > somewhere you have to specify the plugin version for Maven - if you
> don't
> > do it in
> > A parent pom you have to put it in your project's pom file.
> > The advantage to specify the version in a parent pom is that you will
> > inherit the plugin version
> > in all child projects.
> >
> > HTH,
> >
> > Michael
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Rodrigo Madera [mailto:rodrigo.madera@gmail.com]
> > Gesendet: Montag, 24. September 2007 09:39
> > An: users@felix.apache.org
> > Betreff: Having problems with maven-bundle-plugin
> >
> > Hello,
> >
> > I'm having some troubles with the plugin.
> >
> > In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html
> ),
> > the plugin example doesn't specify a version:
> >
> > ...
> > <plugins>
> >    <plugin>
> >     <groupId>org.apache.felix</groupId>
> >      <artifactId>maven-bundle-plugin</artifactId>
> >     <extensions>true</extensions>
> >     <configuration>
> >       <instructions>
> >         <Export-Package>org.foo.myproject.api</Export-Package>
> >         <Private-Package>org.foo.myproject.*</Private-Package>
> >         <Bundle-Activator>org.foo.myproject.impl1.Activator
> > </Bundle-Activator>
> >       </instructions>
> >     </configuration>
> >    </plugin>
> > </plugins>
> > ...
> >
> >
> > Note that <version> is absent in the plugin section.
> >
> > However, in my pom.xml if I don't explicitly specify a <version> tag for
> > it,
> > it fails with:
> >
> >     [INFO] Scanning for projects...
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [ERROR] BUILD ERROR
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not
> > exist
> > or no valid version could be found
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] For more information, run Maven with the -e switch
> >     [INFO]
> > ------------------------------------------------------------------------
> >     [INFO] Total time: < 1 second
> >     [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
> >     [INFO] Final Memory: 1M/4M
> >     [INFO]
> > ------------------------------------------------------------------------
> >
> > Does anyone know why this is happening? If I specify the version it
> works,
> > but I figure that I shouldn't put it there.
> >
> > I am also having other problems, but I will post later, if I can still
> not
> > figure it out with this version information.
> >
> > Thank you,
> > Rodrigo
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>



-- 
Cheers, Stuart

Re: Having problems with maven-bundle-plugin

Posted by Rodrigo Madera <ro...@gmail.com>.
Ok thanks, but also regarding the plugin, check this piece of code:

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.1.0-SNAPSHOT</version>

                <extensions>true</extensions>

                <configuration>
                    <instructions>
                        <Export-Package>com.acme.*</Export-Package>
                    </instructions>
                </configuration>
                <!--executions>
                    <execution>
                        <id>Packaging Bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions-->
            </plugin>

This pom has the packaging set to "bundle", and I also have a BND
configuration section (which I omitted for brevity).

The problem is that if I comment out the <executions> section on this code
(the maven-bundle-plugin section) then the SCR plugin will not execute,
rendering me a useless JAR file that doesn't have the exported services on
the OSGI-INF directory.

So basically, if I set packaging=bundle, it should be all automatic, both
BND + SCR, right?
Why am I being forced to set the <executions> tag?

As always, thanks for any help,
Rodrigo

On 9/24/07, Hampel, Michael <mi...@siemens.com> wrote:
>
>
> Hello,
>
> somewhere you have to specify the plugin version for Maven - if you don't
> do it in
> A parent pom you have to put it in your project's pom file.
> The advantage to specify the version in a parent pom is that you will
> inherit the plugin version
> in all child projects.
>
> HTH,
>
> Michael
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Rodrigo Madera [mailto:rodrigo.madera@gmail.com]
> Gesendet: Montag, 24. September 2007 09:39
> An: users@felix.apache.org
> Betreff: Having problems with maven-bundle-plugin
>
> Hello,
>
> I'm having some troubles with the plugin.
>
> In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html),
> the plugin example doesn't specify a version:
>
> ...
> <plugins>
>    <plugin>
>     <groupId>org.apache.felix</groupId>
>      <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <instructions>
>         <Export-Package>org.foo.myproject.api</Export-Package>
>         <Private-Package>org.foo.myproject.*</Private-Package>
>         <Bundle-Activator>org.foo.myproject.impl1.Activator
> </Bundle-Activator>
>       </instructions>
>     </configuration>
>    </plugin>
> </plugins>
> ...
>
>
> Note that <version> is absent in the plugin section.
>
> However, in my pom.xml if I don't explicitly specify a <version> tag for
> it,
> it fails with:
>
>     [INFO] Scanning for projects...
>     [INFO]
> ------------------------------------------------------------------------
>     [ERROR] BUILD ERROR
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not
> exist
> or no valid version could be found
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] For more information, run Maven with the -e switch
>     [INFO]
> ------------------------------------------------------------------------
>     [INFO] Total time: < 1 second
>     [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
>     [INFO] Final Memory: 1M/4M
>     [INFO]
> ------------------------------------------------------------------------
>
> Does anyone know why this is happening? If I specify the version it works,
> but I figure that I shouldn't put it there.
>
> I am also having other problems, but I will post later, if I can still not
> figure it out with this version information.
>
> Thank you,
> Rodrigo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

AW: Having problems with maven-bundle-plugin

Posted by "Hampel, Michael" <mi...@siemens.com>.
 
Hello,

somewhere you have to specify the plugin version for Maven - if you don't do it in
A parent pom you have to put it in your project's pom file.
The advantage to specify the version in a parent pom is that you will inherit the plugin version
in all child projects.

HTH,

Michael



-----Ursprüngliche Nachricht-----
Von: Rodrigo Madera [mailto:rodrigo.madera@gmail.com] 
Gesendet: Montag, 24. September 2007 09:39
An: users@felix.apache.org
Betreff: Having problems with maven-bundle-plugin

Hello,

I'm having some troubles with the plugin.

In this page (http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html),
the plugin example doesn't specify a version:

...
<plugins>
   <plugin>
    <groupId>org.apache.felix</groupId>
     <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <instructions>
        <Export-Package>org.foo.myproject.api</Export-Package>
        <Private-Package>org.foo.myproject.*</Private-Package>
        <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator>
      </instructions>
    </configuration>
   </plugin>
</plugins>
...


Note that <version> is absent in the plugin section.

However, in my pom.xml if I don't explicitly specify a <version> tag for it,
it fails with:

    [INFO] Scanning for projects...
    [INFO]
------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO]
------------------------------------------------------------------------
    [INFO] The plugin 'org.apache.felix:maven-bundle-plugin' does not exist
or no valid version could be found
    [INFO]
------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO]
------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Mon Sep 24 04:31:32 BRT 2007
    [INFO] Final Memory: 1M/4M
    [INFO]
------------------------------------------------------------------------

Does anyone know why this is happening? If I specify the version it works,
but I figure that I shouldn't put it there.

I am also having other problems, but I will post later, if I can still not
figure it out with this version information.

Thank you,
Rodrigo

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