You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Michal Dabrowski <mi...@gmail.com> on 2019/02/04 13:44:12 UTC

Karaf 4.2.2 Set jre.properties before assembly building startup stage

Hi,

I know there are few ways to set the jre.properties file content but none of
them works in my case. For example, I use karaf-maven-plugin to build karaf
assembly and I have an Ignite profile listed in my startupProfiles:

      <startupProfiles>
                        <profile>my-ignite-profile</profile>
      </startupProfiles>

my-ignite-profile contains ignite-core dependency that uses some low level
stuff from com.sun.management. Building of the assembly fails during startup
stage (Startup stage -> Resolving startup features and bundles):

(...)
[INFO] Startup stage
[INFO]    Loading startup repositories
[INFO]    Resolving startup features and bundles
(...)
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time:  6.930 s
[INFO] Finished at: 2019-02-04T14:19:24+01:00
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.2.2:assembly
(process-resources) on project karaf4: Unable to build assembly: Unable to
resolve root: missing requirement 
(...)
caused by: Unable to resolve org.apache.ignite.ignite-core/2.7.0: missing
requirement [org.apache.ignite.ignite-core/2.7.0] osgi.wiring.package;
filter:="(osgi.wiring.package=com.sun.management)"

The problem is that overriding of jre.properties file happens after the
startup stage.

I tried:
* assembly-property-edits.xml file
* jre.properties file in resources folder

all of these methods changes jre.properties file after startup stage. I
found connected jira https://issues.apache.org/jira/browse/KARAF-5781 that
changed order of applying assembly-property-edits.xml file. The earlier way
worked in my scenario.

Is there any way to set jre.properties before startup stage?



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.2 Set jre.properties before assembly building startup stage

Posted by Michal Dabrowski <mi...@gmail.com>.
It fails at build time as stated in provided log. I think it is because
jre.properties file is updated/overridden after the stage where startup
profile requirements resolvement happens. One of these bundles needs
com.sun.management which at this moment is not listed in jre.properties
file.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.2 Set jre.properties before assembly building startup stage

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

You mean at runtime or build time ?

jre.properties is supposed to be provided at build time (or before
starting).

Regards
JB

On 04/02/2019 14:44, Michal Dabrowski wrote:
> Hi,
> 
> I know there are few ways to set the jre.properties file content but none of
> them works in my case. For example, I use karaf-maven-plugin to build karaf
> assembly and I have an Ignite profile listed in my startupProfiles:
> 
>       <startupProfiles>
>                         <profile>my-ignite-profile</profile>
>       </startupProfiles>
> 
> my-ignite-profile contains ignite-core dependency that uses some low level
> stuff from com.sun.management. Building of the assembly fails during startup
> stage (Startup stage -> Resolving startup features and bundles):
> 
> (...)
> [INFO] Startup stage
> [INFO]    Loading startup repositories
> [INFO]    Resolving startup features and bundles
> (...)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time:  6.930 s
> [INFO] Finished at: 2019-02-04T14:19:24+01:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.karaf.tooling:karaf-maven-plugin:4.2.2:assembly
> (process-resources) on project karaf4: Unable to build assembly: Unable to
> resolve root: missing requirement 
> (...)
> caused by: Unable to resolve org.apache.ignite.ignite-core/2.7.0: missing
> requirement [org.apache.ignite.ignite-core/2.7.0] osgi.wiring.package;
> filter:="(osgi.wiring.package=com.sun.management)"
> 
> The problem is that overriding of jre.properties file happens after the
> startup stage.
> 
> I tried:
> * assembly-property-edits.xml file
> * jre.properties file in resources folder
> 
> all of these methods changes jre.properties file after startup stage. I
> found connected jira https://issues.apache.org/jira/browse/KARAF-5781 that
> changed order of applying assembly-property-edits.xml file. The earlier way
> worked in my scenario.
> 
> Is there any way to set jre.properties before startup stage?
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com