<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Anyone was able to use awssdk in a Liferay 7 module</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121305393" />
  <subtitle>Anyone was able to use awssdk in a Liferay 7 module</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121305393</id>
  <updated>2026-08-02T11:15:28Z</updated>
  <dc:date>2026-08-02T11:15:28Z</dc:date>
  <entry>
    <title>RE: Anyone was able to use awssdk in a Liferay 7 module</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121306971" />
    <author>
      <name>Marc-Andre Gauthier</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121306971</id>
    <updated>2021-12-23T15:41:16Z</updated>
    <published>2021-12-23T14:43:15Z</published>
    <summary type="html">&lt;p&gt;Thanks Olaf. &lt;/p&gt;
&lt;p&gt;I was hoping you wouldn't say that :)&lt;/p&gt;
&lt;p&gt;I was a bit lazy and trying to avoid loading transitive dependencies
  one by one as AWS sdk has lots of them. &lt;/p&gt;
&lt;p&gt;But since you confirmed that this is the case, I dig a bit more and I
  found something that is working. It was a bit of a head scratcher but
  maybe it will help somebody else:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I created a empty maven Java project&lt;/li&gt;
  &lt;li&gt;Following this &amp;quot;how to&amp;quot;, I exported the AWS-SDK library
    as an OSGI module using the &lt;strong&gt;maven-bundle-plugin&lt;/strong&gt;
    from org.apache.felix  &lt;ul&gt;
      &lt;li&gt;The important bit is the 
        &amp;lt;Embed-Transitive&amp;gt;true&amp;lt;/Embed-Transitive&amp;gt; in the
        instructions section of the POM file&lt;/li&gt;
      &lt;li&gt;Ref: https://myaemlearnings.blogspot.com/2021/02/createbuild-and-install-osgi-bundle-of.html&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
  &lt;li&gt;Running the &amp;quot;&lt;strong&gt;package&lt;/strong&gt;&amp;quot; maven task
    creates a jar file in the target directory that contains all the
    required files, including transitive dependencies&lt;/li&gt;
  &lt;li&gt;I loaded the jar file as a OSGI module in Liferay's runtime&lt;/li&gt;
  &lt;li&gt;I used the following line in build.gradle of the module using the
    AWS sdk  &lt;ul&gt;
      &lt;li&gt;runtime &amp;quot;software.amazon.awssdk:your.artifact.id:x.y.z&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Notes:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I exported the complete aws library using the following
    &amp;quot;&lt;strong&gt;bundle&lt;/strong&gt;&amp;quot; dependency so the jar file is
    quite big (around 300M)   &lt;ul&gt;
      &lt;li&gt;
        &lt;pre&gt;
&amp;lt;dependencies&amp;gt;
    &amp;lt;dependency&amp;gt;
        &amp;lt;groupId&amp;gt;software.amazon.awssdk&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;bundle&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;2.17.102&amp;lt;/version&amp;gt;
    &amp;lt;/dependency&amp;gt;
&amp;lt;/dependencies&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
  &lt;li&gt;I think it would be possible to create smaller osgi modules by
    exporting just parts of the SDK but I didn't try it. &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Thanks again Olaf, your comments are always helpful. &lt;/p&gt;</summary>
    <dc:creator>Marc-Andre Gauthier</dc:creator>
    <dc:date>2021-12-23T14:43:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Anyone was able to use awssdk in a Liferay 7 module</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121306094" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121306094</id>
    <updated>2021-12-22T09:59:54Z</updated>
    <published>2021-12-22T09:59:54Z</published>
    <summary type="html">&lt;p&gt;The problem with compileInclude is that you'll also need to make sure
  transitive dependencies are available - those are the missing imports
  that you see.&lt;/p&gt;
&lt;p&gt;As far as I know, you can satisfy those dependencies at runtime, when
  you deploy them to the OSGi runtime (in case the dependencies are OSGi
  conforming bundles) or you compileInclude them as well. Or you could
  avoid functions that need those transitive dependencies: Often such
  APIs are offering more than you'd immediately need. But that's
  apparently not the case in this situation.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2021-12-22T09:59:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Anyone was able to use awssdk in a Liferay 7 module</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305658" />
    <author>
      <name>Marc-Andre Gauthier</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305658</id>
    <updated>2021-12-22T01:18:26Z</updated>
    <published>2021-12-22T01:18:26Z</published>
    <summary type="html">&lt;p&gt;Tried adding &lt;/p&gt;
&lt;p&gt;compileInclude 'software.amazon.awssdk:s3:2.17.100'    &lt;br /&gt;
  compileInclude 'software.amazon.awssdk:sdk-core:2.17.100'&lt;/p&gt;
&lt;p&gt;to my build.gradle&lt;/p&gt;
&lt;p&gt;Still getting loads of problems deploying module&lt;/p&gt;
&lt;p&gt;Unresolved requirement: Import-Package: xyz&lt;/p&gt;
&lt;p&gt;like com.google.protobuf etc.&lt;/p&gt;</summary>
    <dc:creator>Marc-Andre Gauthier</dc:creator>
    <dc:date>2021-12-22T01:18:26Z</dc:date>
  </entry>
  <entry>
    <title>Anyone was able to use awssdk in a Liferay 7 module</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305392" />
    <author>
      <name>Marc-Andre Gauthier</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121305392</id>
    <updated>2021-12-21T18:49:48Z</updated>
    <published>2021-12-21T18:49:48Z</published>
    <summary type="html">&lt;p&gt;We are trying to use Amazon AWS java sdk (1.x or2.x) in our Liferay
  7.4.3.4 ga4 module.&lt;/p&gt;
&lt;p&gt;Anyone got this working?&lt;/p&gt;
&lt;p&gt;Would be appreciated if someone could give us the recipe. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks in advance. &lt;/p&gt;</summary>
    <dc:creator>Marc-Andre Gauthier</dc:creator>
    <dc:date>2021-12-21T18:49:48Z</dc:date>
  </entry>
</feed>
