You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Cl...@raibau.at on 2009/03/09 10:26:55 UTC

maven-bundle-plugin uses only the source directory defined by pom.xml: feature or bug?

Hello,

I have source directories that are added to my maven project during the 
generate-sources phase, but maven-bundle-plugin ignores this directories. 
Is this intentional? 

Here a small example that shows what is happening: for the project tree 
below, the source directories java_internal and java_public are added to 
my maven project by some plugin, and maven-bundle-plugin is configured as 
follows:
<configuration>
  <instructions>
    <Bundle-Activator>foo.internal.FooActivator</Bundle-Activator>
  </instructions>
</configuration>

My problem is that the package "foo_public" is not exported, and I get an 
error from bnd:  "Bundle-Activator not found on the bundle class path nor 
in imports: foo.internal.FooActivator"

\---main
    +---java
    |   \---foo_default
    |           FooFrame.java
    |
    +---java_internal
    |   \---foo
    |       \---internal
    |               FooActivator.java
    |
    +---java_public
    |   \---foo_public
    |           FooButton.java
    |
    \---resources
        \---foo
            \---internal
                    text.txt

Thanks

-- clovis

______________________________________
Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. 

This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards.

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


Re: Re: maven-bundle-plugin uses only the source directory defined by pom.xml: feature or bug?

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/3/9 <Cl...@raibau.at>

> > yes, that's correct because the Maven Project API only gives us one
> source
> > directory:
> >
> >    project.getBuild().getSourceDirectory()
> >
> > presumably the extra source directories are available elsewhere using
> > another API,
> > but as scanning sources is a recently new feature I decided to keep it
> > simple for now.
>
> project.getCompileSourceRoots() is available since May 2006. (
> http://repo2.maven.org/maven2/org/apache/maven/maven-project/2.0/)


thanks, feel free to code up and submit a patch to bundleplugin on JIRA


> What do you mean by "recently new feature"?
>

meaning I added scanning of sources to the bundleplugin a week or so
before releasing 2.0.0 along with a number of other fixes and features
(see the changelog in the 2.0.0 announcement) - so it's a new addition
to the bundleplugin which just scans the main source directory for now

[ more code == more chance of bugs == potentially delayed release ]

previous releases of the bundleplugin used the groupId and artifactId
to guess at the primary package name, which meant that you had to
provide explicit Private-Package / Export-Package settings for most
bundle projects... so the situation has improved

later bundleplugin releases will probably enhance the source scanning
- of course there's more chance of this happening if people provide me
with patches, otherwise it depends when I have time to code it myself

______________________________________
> Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten.
> Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns
> unverzueglich zu informieren und sie zu loeschen.
>
> This e-mail message may contain information, which is confidential and
> protected. If you are not the intended recipient of this message, we ask you
> to inform us immediately and delete the message afterwards.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
> --
Cheers, Stuart

Antwort: Re: maven-bundle-plugin uses only the source directory defined by pom.xml: feature or bug?

Posted by Cl...@raibau.at.
> yes, that's correct because the Maven Project API only gives us one 
source
> directory:
> 
>    project.getBuild().getSourceDirectory()
> 
> presumably the extra source directories are available elsewhere using
> another API,
> but as scanning sources is a recently new feature I decided to keep it
> simple for now.

project.getCompileSourceRoots() is available since May 2006. (
http://repo2.maven.org/maven2/org/apache/maven/maven-project/2.0/) 
What do you mean by "recently new feature"? 


______________________________________
Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu informieren und sie zu loeschen. 

This e-mail message may contain information, which is confidential and protected. If you are not the intended recipient of this message, we ask you to inform us immediately and delete the message afterwards.

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


Re: maven-bundle-plugin uses only the source directory defined by pom.xml: feature or bug?

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/3/9 <Cl...@raibau.at>

> Hello,
>
> I have source directories that are added to my maven project during the
> generate-sources phase, but maven-bundle-plugin ignores this directories.
> Is this intentional?
>

yes, that's correct because the Maven Project API only gives us one source
directory:

   project.getBuild().getSourceDirectory()

presumably the extra source directories are available elsewhere using
another API,
but as scanning sources is a recently new feature I decided to keep it
simple for now.

if you happen to find out the Maven API to get all the configured source
directories feel
free to submit a patch via JIRA, until then you'll need to add the necessary
instructions
(ie. Export-Package / Private-Package) to pull in the right packages for
this situation

Here a small example that shows what is happening: for the project tree
> below, the source directories java_internal and java_public are added to
> my maven project by some plugin, and maven-bundle-plugin is configured as
> follows:
> <configuration>
>  <instructions>
>    <Bundle-Activator>foo.internal.FooActivator</Bundle-Activator>
>  </instructions>
> </configuration>
>
> My problem is that the package "foo_public" is not exported, and I get an
> error from bnd:  "Bundle-Activator not found on the bundle class path nor
> in imports: foo.internal.FooActivator"
>
> \---main
>    +---java
>    |   \---foo_default
>    |           FooFrame.java
>    |
>    +---java_internal
>    |   \---foo
>    |       \---internal
>    |               FooActivator.java
>    |
>    +---java_public
>    |   \---foo_public
>    |           FooButton.java
>    |
>    \---resources
>        \---foo
>            \---internal
>                    text.txt
>
> Thanks
>
> -- clovis
>
> ______________________________________
> Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten.
> Wenn diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns
> unverzueglich zu informieren und sie zu loeschen.
>
> This e-mail message may contain information, which is confidential and
> protected. If you are not the intended recipient of this message, we ask you
> to inform us immediately and delete the message afterwards.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart