Skip to Content
author's profile photo Former Member
Former Member

Override core library jars

In Hybris 5.4.0.0, joda-time-2.0.jar resides in bin/platform/ext/core/lib/.

I want to use the latest version of Amazon Web Services SDK. It requires joda time 2.2 or above.

I tried putting joda-time-2.2.jar in my own extension's /lib directory, but Hybris still class loads the 2.0 jar bundled in core.

Short of replacing the jar in core/lib, which I prefer not to, is there another way to override bundled jars?

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 03, 2015 at 11:38 PM

    Hi Shaun,

    You can make use of buildcallbacks.xml for your case which is mainly used to hook into build process and help to remove jar conflicts. The buildcallbacks.xml available from hmc provides sample configuration details which will help you to achieve your need. The sample code given in hmc is similar to your case.

     <macrodef name="hmc_before_ear">
             <sequential>
                 <if>
                     <equals arg1="${ear.target.appserver}" arg2="jboss" />
                     <then>
                         <echo message="*** special jboss handling: removing xalan*.jar from ext/core (otherwise this will clash with jboss/lib/endorsed/xalan.jar)" />
                         <delete>
                             <fileset dir="${ear.libs.path}">
                                 <include name="xalan-*.jar" />
                             </fileset>
                         </delete>
                     </then>
                 </if>
             </sequential>
         </macrodef>
     
    

    Please do let me know if you have any more questions.

    Thanks

    Jayahar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2016 at 12:17 PM

    Hi all, I have used the same code in my file, but It not works. The jar commons-httpclient-3.1 is deprecated and go in conflict with http-client jar. I have used the follow code in buildcallback.xml of my custom modul wsmonitoring:

     <macrodef name="wsmonitoring_before_build">
         <sequential>
         <echo message="*** TEST JAR NOT INCLUDE: ${platformhome} commons-httpclient-3.1.jar ****" />
             <delete>
                  <fileset dir="${platformhome}/lib">
                      <include name="commons-httpclient-3.1.jar" />
                 </fileset>
              </delete>
         </sequential>
     </macrodef>
    
    

    In effect, I want remove the commons-httpclient from build. Thanks in advance to all for any suggestions.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 05, 2020 at 10:33 AM

    1 Add you library to {yourProject}\config\customize\platform\ext\core\lib

    2 If you want replace jar by new version, you can add new jar to this folder. But after customize on 3 step you will see, that in platform libraries 2 jars: old version and new version. To keep only new version rename your new version to old version. In this case hybris will use jar that named as old file, but inside it will be with new jar version

    3 ant customize

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.