Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-9526

Compiling the source code without git repo fails at openam-clientsdk module

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 13.5.0, 14.0.0
    • Fix Version/s: 12.0.4, 13.5.1, 14.0.0
    • Component/s: None
    • Labels:
    • Sprint:
      AM Sustaining Sprint 25, AM Sustaining Sprint 27
    • Support Ticket IDs:

      Description

      How to reproduce?

      Try to compile the 13.5.0 source folder available on backstage.

      Note: this is important that you use this zip, not checking out the tag. No shortcut allowed, git users

      Expected result:

      A success build.

      Current behaviour:

      [INFO] OpenAM Client SDK .................................. FAILURE [  1.528 s]
      [INFO] OpenAM Documentation ............................... SKIPPED
      [INFO] OpenAM Log Message Reference ....................... SKIPPED
      [INFO] OpenAM ssoadm Reference ............................ SKIPPED
      [INFO] OpenAM Distribution Packaging ...................... SKIPPED
      [INFO] OpenAM Distribution Fedlet UnConfigured ............ SKIPPED
      [INFO] OpenAM Distribution ssoAdminTools .................. SKIPPED
      [INFO] OpenAM Distribution ssoConfiguratorTools ........... SKIPPED
      [INFO] OpenAM Example Projects ............................ SKIPPED
      [INFO] OpenAM Example ClientSDK CLI ....................... SKIPPED
      [INFO] OpenAM Example ClientSDK WAR ....................... SKIPPED
      [INFO] OpenAM Distribution Kit ............................ SKIPPED
      [INFO] OpenAM Distribution Diagnostics .................... SKIPPED
      [INFO] OpenAM Soap STS .................................... SKIPPED
      [INFO] OpenAM SOAP STS Server ............................. SKIPPED
      [INFO] OpenAM SOAP STS Client ............................. SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4.204 s
      [INFO] Finished at: 2016-08-03T14:54:48+01:00
      [INFO] Final Memory: 114M/601M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project openam-clientsdk: Error creating shaded jar: java.util.jar.Attributes cannot be cast to java.lang.String -> [Help 1]
      

      Why on earth is it failing ?!

      We are actually hitting a library bug: https://issues.apache.org/jira/browse/MSHADE-183

      Our current version of maven-shade-plugin is 2.1

                      <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-shade-plugin</artifactId>
                          <version>2.1</version>
                      </plugin>
      

      and the problem is that, in our usage of the library, we do:

      <transformers>
                              <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                  <manifestEntries>
                                      <Specification-Title>OpenAM Java CLient SDK</Specification-Title>
                                      <Specification-Version>${project.version} - ${maven.build.timestamp}</Specification-Version>
                                      <Specification-Vendor>ForgeRock</Specification-Vendor>
                                      <Implementation-Title>OpenAM Java Client SDK</Implementation-Title>
                                      <Implementation-Version>${project.version} - ${maven.build.timestamp}</Implementation-Version>
                                      <Implementation-Vendor>ForgeRock</Implementation-Vendor>
                                      <Built-By>${user.name}</Built-By>
                                      <Build-Jdk>${java.version}</Build-Jdk>
                                      <Build-Time>${maven.build.timestamp}</Build-Time>
                                      <Version>${project.version}</Version>
                                      <Create-On>${maven.build.timestamp}</Create-On>
                                      <Revision>${git.short.sha1}</Revision>
                                      <!-- TODO Add License to Manifest -->
                                  </manifestEntries>
                              </transformer>
                          </transformers>
      

      The bug is only happening if <Revision>${git.short.sha1}</Revision> is empty, which is the case for the src folder, but not from the git project.

      Workaround:

      If you try to compile the tag, it will work, as it is a git project.
      Easiest way is probably to update the library version in the pom.xml to 2.4

        Attachments

          Activity

            People

            • Assignee:
              quentin.castel Quentin CASTEL [X] (Inactive)
              Reporter:
              quentin.castel Quentin CASTEL [X] (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2h Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2.25h
                2.25h