You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Alasdair Nottingham (JIRA)" <ji...@apache.org> on 2011/02/02 18:37:29 UTC

[jira] Created: (FELIX-2819) packageinfo files in src/main/java are ignored

packageinfo files in src/main/java are ignored
----------------------------------------------

                 Key: FELIX-2819
                 URL: https://issues.apache.org/jira/browse/FELIX-2819
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
            Reporter: Alasdair Nottingham


The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.

The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.

The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?

Thanks
Alasdair


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990098#comment-12990098 ] 

Alasdair Nottingham commented on FELIX-2819:
--------------------------------------------

I didn't realize the package-info.java would be picked up, but I have some packages which are copied from the OSGi git repo and they use package.html and packageinfo. I don't feel comfortable rewriting these to be package-info.java instead. It is worth considering though.



> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch resolved FELIX-2819.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: maven-bundle-plugin-2.3.5
         Assignee: Stuart McCulloch

Fixed in r1139399

> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.3.5
>
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Simon Chemouil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990744#comment-12990744 ] 

Simon Chemouil commented on FELIX-2819:
---------------------------------------

By the way, if you're not doing it already (or for people who might read this issue), here's the cleanest workaround :

   <project ...>
	<build>
	        <!-- A lot of stuff may go here-->
		<resources>
	                <!-- You have to keep this only if you want to keep the default Maven layout as well-->                        
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>

	                <!-- Here's the magic stuff: include everything except Java and hidden files (eg, .svn directories) -->                        
			<resource>
				<directory>${project.build.sourceDirectory}</directory>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/.*</exclude>
				</excludes>
			</resource>

	                <!-- Alternatively, you may want to include only packageinfo files (if so, remove the previous
                              <resource/> block that is a superset of this one) -->                        
		        <resource>
			        <directory>${project.build.sourceDirectory}</directory>
				<includes>
					<include>**/packageinfo</include>
				</includes>
			</resource>

		</resources>

                <!-- A lot more stuff, including maven-bundle-plugin if you don't use pluginManagement in a parent POM -->
  	</build>
   </project>

On our project we put the "include all resources that are in src/" rule in a parent POM... Of course, it would still be nice if maven-bundle-plugin would manage bnd-related files out-of-the-box.

Hope this helps,

Simon

> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990756#comment-12990756 ] 

Alasdair Nottingham edited comment on FELIX-2819 at 2/4/11 9:34 PM:
--------------------------------------------------------------------

That said, words is all you'll get, but thanks again.

Alasdair

      was (Author: not):
    That said, works is all you'll get, but thanks again.

Alasdair
  
> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Simon Chemouil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989749#comment-12989749 ] 

Simon Chemouil commented on FELIX-2819:
---------------------------------------

This would be nice indeed.

Just for the record (you might find it useful), we use the @Version bnd annotation on the package statement in the package-info.java file to achieve the same, and Maven is happy with this since it's a Java source file.

E.g,

@Version("1.0.2")
package com.mycompany.myproject.mypackage

import aQute.bnd.annotation;

One thing nice with this is that it's possible to use a String constant defined in a Java class, for those times when we want to make the version a part of the Java API... And this usage finally makes package-info.java interesting for more than just package javadoc. Drawbacks are that we depend on bnd.annotation's JAR at compile time only for manifest generation, and that no tool that I know of updates these versions when the API evolves.

Hope this helps.

> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990755#comment-12990755 ] 

Alasdair Nottingham commented on FELIX-2819:
--------------------------------------------

Words alone cannot express my joy at learning about this workaround. Thank you very much.

Alasdair

> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990756#comment-12990756 ] 

Alasdair Nottingham commented on FELIX-2819:
--------------------------------------------

That said, works is all you'll get, but thanks again.

Alasdair

> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Simon Chemouil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990744#comment-12990744 ] 

Simon Chemouil edited comment on FELIX-2819 at 2/4/11 9:17 PM:
---------------------------------------------------------------

By the way, if you're not doing it already (or for people who might read this issue), here's the cleanest workaround :

{code:XML}
   <project>
	<build>
	        <!-- A lot of stuff may go here-->
		<resources>
	                <!-- You have to keep this only if you want to keep the default Maven layout as well-->                        
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>

	                <!-- Here's the magic stuff: include everything except Java and hidden files (eg, .svn directories) -->                        
			<resource>
				<directory>${project.build.sourceDirectory}</directory>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/.*</exclude>
				</excludes>
			</resource>

	                <!-- Alternatively, you may want to include only packageinfo files (if so, remove the previous
                              <resource/> block that is a superset of this one) -->                        
		        <resource>
			        <directory>${project.build.sourceDirectory}</directory>
				<includes>
					<include>**/packageinfo</include>
				</includes>
			</resource>

		</resources>

                <!-- A lot more stuff, including maven-bundle-plugin if you don't use pluginManagement in a parent POM -->
  	</build>
   </project>
{code}
On our project we put the "include all resources that are in src/" rule in a parent POM... Of course, it would still be nice if maven-bundle-plugin would manage bnd-related files out-of-the-box.

Hope this helps,

Simon

Edit: formating is completely messed up... 

      was (Author: magnet):
    By the way, if you're not doing it already (or for people who might read this issue), here's the cleanest workaround :

{code:XML}
   <project ...>
	<build>
	        <!-- A lot of stuff may go here-->
		<resources>
	                <!-- You have to keep this only if you want to keep the default Maven layout as well-->                        
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>

	                <!-- Here's the magic stuff: include everything except Java and hidden files (eg, .svn directories) -->                        
			<resource>
				<directory>${project.build.sourceDirectory}</directory>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/.*</exclude>
				</excludes>
			</resource>

	                <!-- Alternatively, you may want to include only packageinfo files (if so, remove the previous
                              <resource/> block that is a superset of this one) -->                        
		        <resource>
			        <directory>${project.build.sourceDirectory}</directory>
				<includes>
					<include>**/packageinfo</include>
				</includes>
			</resource>

		</resources>

                <!-- A lot more stuff, including maven-bundle-plugin if you don't use pluginManagement in a parent POM -->
  	</build>
   </project>
{code}
On our project we put the "include all resources that are in src/" rule in a parent POM... Of course, it would still be nice if maven-bundle-plugin would manage bnd-related files out-of-the-box.

Hope this helps,

Simon
  
> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (FELIX-2819) packageinfo files in src/main/java are ignored

Posted by "Simon Chemouil (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990744#comment-12990744 ] 

Simon Chemouil edited comment on FELIX-2819 at 2/4/11 9:14 PM:
---------------------------------------------------------------

By the way, if you're not doing it already (or for people who might read this issue), here's the cleanest workaround :

{code:XML}
   <project ...>
	<build>
	        <!-- A lot of stuff may go here-->
		<resources>
	                <!-- You have to keep this only if you want to keep the default Maven layout as well-->                        
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>

	                <!-- Here's the magic stuff: include everything except Java and hidden files (eg, .svn directories) -->                        
			<resource>
				<directory>${project.build.sourceDirectory}</directory>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/.*</exclude>
				</excludes>
			</resource>

	                <!-- Alternatively, you may want to include only packageinfo files (if so, remove the previous
                              <resource/> block that is a superset of this one) -->                        
		        <resource>
			        <directory>${project.build.sourceDirectory}</directory>
				<includes>
					<include>**/packageinfo</include>
				</includes>
			</resource>

		</resources>

                <!-- A lot more stuff, including maven-bundle-plugin if you don't use pluginManagement in a parent POM -->
  	</build>
   </project>
{code}
On our project we put the "include all resources that are in src/" rule in a parent POM... Of course, it would still be nice if maven-bundle-plugin would manage bnd-related files out-of-the-box.

Hope this helps,

Simon

      was (Author: magnet):
    By the way, if you're not doing it already (or for people who might read this issue), here's the cleanest workaround :

   <project ...>
	<build>
	        <!-- A lot of stuff may go here-->
		<resources>
	                <!-- You have to keep this only if you want to keep the default Maven layout as well-->                        
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>

	                <!-- Here's the magic stuff: include everything except Java and hidden files (eg, .svn directories) -->                        
			<resource>
				<directory>${project.build.sourceDirectory}</directory>
				<excludes>
					<exclude>**/*.java</exclude>
					<exclude>**/.*</exclude>
				</excludes>
			</resource>

	                <!-- Alternatively, you may want to include only packageinfo files (if so, remove the previous
                              <resource/> block that is a superset of this one) -->                        
		        <resource>
			        <directory>${project.build.sourceDirectory}</directory>
				<includes>
					<include>**/packageinfo</include>
				</includes>
			</resource>

		</resources>

                <!-- A lot more stuff, including maven-bundle-plugin if you don't use pluginManagement in a parent POM -->
  	</build>
   </project>

On our project we put the "include all resources that are in src/" rule in a parent POM... Of course, it would still be nice if maven-bundle-plugin would manage bnd-related files out-of-the-box.

Hope this helps,

Simon
  
> packageinfo files in src/main/java are ignored
> ----------------------------------------------
>
>                 Key: FELIX-2819
>                 URL: https://issues.apache.org/jira/browse/FELIX-2819
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>            Reporter: Alasdair Nottingham
>
> The bnd tool can pick up the package version from a packageinfo file if it is stored next to the java files.
> The maven-bundle-plugin will only include them in the jar, and make them visible to bnd if they are in the src/main/resources directory. I would like to use these files for specifying versions, rather than putting it in the pom. This allows me to specify the version once in this file even if it is repackaged in a different jar later.
> The problem is I have to put the files into src/main/resources which significantly reduces the chance of updating them when a change is made. Could the maven-bundle-plugin be updated to put the packageinfo files from src/main/java into the jar before calling bnd?
> Thanks
> Alasdair

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira