[keycloak-user] Adding libraries from my provider

Anthony Fryer Anthony.Fryer at virginaustralia.com
Thu Apr 21 19:34:44 EDT 2016


That would be included because of your dependency hierarchy (you either depend on antlr or one of the jars you’re using depends on antlr).  It’s up to you to work out if it’s required or not.  If not, then exclude it either in the maven-shade-plugin configuration, or in your maven dependency in pom.xml.

For some jars that I don’t want included in my uber jar, I set the scope of the dependency to “provided”.  An example is hibernate which is already available as a wildfly module that you can configure to use in the module.xml of your provider.  In my pom.xml I have the hibernate dependency at provided scope so maven-shade-plugin won’t include it…

  <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.1-api</artifactId>
      <version>1.0.0.Final</version>
      <scope>provided</scope>
    </dependency>

And my module.xml looks like this so I have access to the hibernate classes from the already available hibernate module…

<module xmlns="urn:jboss:module:1.3" name="com.virginaustralia.velocity.keycloak-velocity-user-federation">
    <resources>
        <resource-root path="my-user-federation-0.0.1-SNAPSHOT.jar"/>
    </resources>
                <exports>
                                <include path="META-INF/**"/>
                </exports>
    <dependencies>
        …
        <module name="org.hibernate" services="import"/>
        …
    </dependencies>

</module>

Cheers,

Anthony

From: Juan Diego [mailto:juandiego83 at gmail.com]
Sent: Friday, 22 April 2016 9:23 AM
To: Anthony Fryer
Cc: keycloak-user
Subject: Re: [keycloak-user] Adding libraries from my provider

This plugin adds an antlr folder with tons of stuff is that needed?

On Thu, Apr 21, 2016 at 5:06 PM, Anthony Fryer <Anthony.Fryer at virginaustralia.com<mailto:Anthony.Fryer at virginaustralia.com>> wrote:
Hi Juan,

I’m not sure if this is recommended or not, but an option I’m using at the moment that works quite well is to use the maven-shade-plugin to create an uber jar that contains all the classes of the dependencies of my provider jar.  This makes it easy during the development stage because I can just deploy a single jar file.  Maybe later I’ll look into splitting jars out into separate modules.

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>

Cheers,

Anthony

From: keycloak-user-bounces at lists.jboss.org<mailto:keycloak-user-bounces at lists.jboss.org> [mailto:keycloak-user-bounces at lists.jboss.org<mailto:keycloak-user-bounces at lists.jboss.org>] On Behalf Of Juan Diego
Sent: Friday, 22 April 2016 5:46 AM
To: keycloak-user
Subject: [keycloak-user] Adding libraries from my provider

Is there a recommended way to add a custom library to a provider or should I just added as a module in my wildfly?
Thanks
The content of this e-mail, including any attachments, is a confidential communication between Virgin Australia Airlines Pty Ltd (Virgin Australia) or its related entities (or the sender if this email is a private communication) and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). There is no warranty that this email is error, virus or defect free. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. If this is a private communication it does not represent the views of Virgin Australia or its related entities. Please be aware that the contents of any emails sent to or from Virgin Australia or its related entities may be periodically monitored and reviewed. Virgin Australia and its related entities respect your privacy. Our privacy policy can be accessed from our website: www.virginaustralia.com<http://www.virginaustralia.com>

The content of this e-mail, including any attachments, is a confidential communication between Virgin Australia Airlines Pty Ltd (Virgin Australia) or its related entities (or the sender if this email is a private communication) and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). There is no warranty that this email is error, virus or defect free. This email is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. If this is a private communication it does not represent the views of Virgin Australia or its related entities. Please be aware that the contents of any emails sent to or from Virgin Australia or its related entities may be periodically monitored and reviewed. Virgin Australia and its related entities respect your privacy. Our privacy policy can be accessed from our website: www.virginaustralia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160421/a8fea62f/attachment-0001.html 


More information about the keycloak-user mailing list