You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stuart McCulloch (JIRA)" <ji...@apache.org> on 2007/08/10 04:01:42 UTC

[jira] Created: (FELIX-336) Add support for optimization and obfuscation of bundle contents

Add support for optimization and obfuscation of bundle contents
---------------------------------------------------------------

                 Key: FELIX-336
                 URL: https://issues.apache.org/jira/browse/FELIX-336
             Project: Felix
          Issue Type: New Feature
          Components: Maven Bundle Plugin
    Affects Versions: 0.8.0
            Reporter: Stuart McCulloch
            Priority: Minor
             Fix For: 1.0.0


Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...

Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.

This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch commented on FELIX-336:
----------------------------------------

FYI, the recommended "maven" way of doing that would be to create a new pom for the minijar produced artifact. That way it can be versioned and released independently. You would then use another pom that took the minijar produced artifact (as a dependency) and wrapped it up as a bundle. This approach requires no changes to the bundleplugin.

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Alan Cabrera commented on FELIX-336:
------------------------------------

I'm probably stating the obvious. One should be careful when fragments come into play.  For example, let's say that package r is private in host A.  Fragment B, which also has a private package r, is attached to A.  A and B now share their contents of package r in their classpath, A.r > B.r.  There could always be something in A.r that B.r could use.  So, there's no way to a priori know what to remove from A.r without more knowledge of what fragments will get attached.

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch reassigned FELIX-336:
--------------------------------------

    Assignee: Stuart McCulloch

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: 0.8.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch updated FELIX-336:
-----------------------------------

    Fix Version/s:     (was: 1.2.1)

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: 0.8.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch updated FELIX-336:
-----------------------------------


Target after the 1.1.0 release of the bundleplugin.

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: 0.8.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

Posted by Didier Donsez <di...@imag.fr>.
For obfuscation, ProGuard 
http://snapshot.pyx4me.com/pyx4me-maven-plugins/proguard-maven-plugin/ 
is a well-known obfuscator
Didier

Stuart McCulloch (JIRA) wrote:

>    [ https://issues.apache.org/jira/browse/FELIX-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579108#action_12579108 ] 
>
>Stuart McCulloch commented on FELIX-336:
>----------------------------------------
>
>these plugins work on jarfiles, so it doesn't mind if they come from jar or bnd - for example:
>
>   http://mojo.codehaus.org/minijar-maven-plugin/usage.html
>
>the tricky part is avoiding split packages (ie. only private packages should be compressed)
>
>  
>
>>Add support for optimization and obfuscation of bundle contents
>>---------------------------------------------------------------
>>
>>                Key: FELIX-336
>>                URL: https://issues.apache.org/jira/browse/FELIX-336
>>            Project: Felix
>>         Issue Type: New Feature
>>         Components: Maven Bundle Plugin
>>   Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>>           Reporter: Stuart McCulloch
>>           Priority: Minor
>>
>>Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
>>Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
>>This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.
>>    
>>
>
>  
>


-- 
--------------------------------------------------------------
Didier DONSEZ

Laboratoire LIG, Equipe ADELE
Universite Joseph Fourier
Bat. C, 220 rue de la Chimie, Domaine Universitaire
BP 53, 38041 Grenoble Cedex 9, France
Tel : +33 4 76 63 55 49           Fax : +33 4 76 63 55 50
GPS : lat 45°11'38.3"N, lon 05°46'14.7"E, alt 223m

mailto:Didier.Donsez@imag.fr
URL: http://www-adele.imag.fr/users/Didier.Donsez
Map: http://www-adele.imag.fr/users/Didier.Donsez/map/map.html
--------------------------------------------------------------



[jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch commented on FELIX-336:
----------------------------------------

these plugins work on jarfiles, so it doesn't mind if they come from jar or bnd - for example:

   http://mojo.codehaus.org/minijar-maven-plugin/usage.html

the tricky part is avoiding split packages (ie. only private packages should be compressed)

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stefano Lenzi commented on FELIX-336:
-------------------------------------

How can we use minijar with maven-bundle-plugin? 

Can you provide an example that will be attached to the maven-bundle-plugin documentation?

Also if maven-bundle-plugin allow the interaction with others plugin we can also use proguard-maven-plugin (http://pyx4me.com/pyx4me-maven-plugins/proguard-maven-plugin/index.html)


> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stefano Lenzi commented on FELIX-336:
-------------------------------------

I have just made some testes on "how-to use maven-bundle-plugin with minijar-maven-plugin", and I don't think that they can seamless cooperate (at least at the moment). To perform my tests I have added the following XML to my POM inside the /build/plugins XML part:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>minijar-maven-plugin</artifactId>
        <version>1..0-alpha-3</version>
	<executions>
	  <execution>
	    <id>ueberjar</id>
	    <phase>package</phase>
	    <goals><goal>ueberjar</goal></goals>
            <configuration>
	      <stripUnusedClasses>true</stripUnusedClasses>
	      <includeDependencies>
	        <param>none:dependency</param>
	      </includeDependencies>
            </configuration>
	  </execution>
	</executions>
      </plugin>

The idea behind the setup was that I use maven-bundle-plugin to build my "jar-with-dependencies", then I use the minijar-maven-plugin to strip out the unused classes. 
 1 - You must add the includeDependencies configuration to force minijar to perform only the stripping operation on the bundle generated by the maven-bundle-plugin. If you remove includeDependencies configuration minijar will strip a jar containing either the bundle plus all the compile and runtime scoped dependencies
 2 - We the current setup minijar can not handle pom genereting classified bundles 
 3 - minijar removes the manifest.mf from the resulting jar file
4* - I think that minijar can not cope with embeed jars instead due to the different classloading behavior of the OSGi environment, so minijar can would only works with bundle containing "inlined" classes

IMHO I think that the corrected workflow should be: minijar collects the dependencies and strip them out (during the prepare-package phase). After that, maven-bundle-plugin build a classpath pointing to the stripped artifact instead of the regular one. Finally, BND generates the bundle. 
If you agree with my previous statement we should add an configuration entry to the maven-bundle-plugin that specifies how and where to gather the dependecies jar file from.

At the moment I'm investigating how a integration with proguard-maven-plugin could be achieve.

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stefano Lenzi updated FELIX-336:
--------------------------------

    Affects Version/s:     (was: felix-0.8.0)
                       maven-bundle-plugin-1.4.0
                       maven-bundle-plugin-1.2.1
                       maven-bundle-plugin-1.2.0

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.2.0, maven-bundle-plugin-1.2.1, maven-bundle-plugin-1.4.0
>            Reporter: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-336) Add support for optimization and obfuscation of bundle contents

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

Stuart McCulloch updated FELIX-336:
-----------------------------------

    Fix Version/s:     (was: 1.0.0)

> Add support for optimization and obfuscation of bundle contents
> ---------------------------------------------------------------
>
>                 Key: FELIX-336
>                 URL: https://issues.apache.org/jira/browse/FELIX-336
>             Project: Felix
>          Issue Type: New Feature
>          Components: Maven Bundle Plugin
>    Affects Versions: 0.8.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>            Priority: Minor
>
> Suggestion from felix mailing list: it would be useful if the bundle-plugin could optimize the contents of the bundle (ie. discard unnecessary internal contents) and possibly perform some obfuscation. Ideally we wouldn't want to discard classes from exported packages as that would lead to split-packages...
> Currently, it's possible to use the minijar plugin to optimize the bundle, but this could discard exported classes as it has no OSGi knowledge.
> This issue will be used to collect together designs and opinions on baking such support into the bundle-plugin compared to keeping it separate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.