Skip to Content
Author's profile photo Marion Schlotte

Simplify DC structures for External Libraries

Adding an external library facet to a J2EE Server Component Library DC

Starting with NW 7.0 SP13 the software component provided by SAP SAP_BUILDT (includes the main build plugins) is enhanced with a new Development Component with the name tc/bi/fct/extlib. This facet DC can be used to simplify DC structures a bit by allowing developers to combine the functionality of an “External Library” DC with a “J2EE Server Component Library” DC.

Use Case

You want to use some Java libraries that were produced outside of NWDI. Since you want to reuse those libraries within your application development you need to package these libaries in a component model format – a Development Component (DC).

For developments prior to NW 7.0 SP13 this meant you had to do the following:

  1. Create a new DC of type “External Library”
  2. Put the jar file(s) into the folder “library” of the “External Library” DC
  3. Create two public parts (compilation and assembly)
  4. Add the jar file(s) as entities to both public parts
  5. Build the “External Library” DC
  6. Create a second DC of type “J2EE Server Component Library”
  7. Add a build-time dependency to both public parts of the “External Library” DC
  8. Build the “J2EE Server Component Library” DC

With the new external library facet included since NW 7.0 SP13 the process is much simplier:

    1. Create a new DC of type “J2EE Server Component Library”
    2. Add a build-time dependency to the “def” public part of the new facet DC tc/bi/fct/extlib


    1. Create a local “libs” folder below the root folder and put the jar file(s) into that folder
    2. Define that libs folder as source folder in the DC Metadata >



  1. Build the DC



While this may not look much shorter in this list here you will find that it takes much less time and keeps the DC structure much more simple. Just try it.

Verifying the result

If you kept to the explanation above you should have

  • a public part with the name deflib that contains your jar file
  • an SDA file in the gen/default/deploy folder that contains the added jar file(s)
  • a provider.xml descriptor file contained in the SDA file with appropriate entries for each jar file


Problem: The jar files of the external libraries are neither packaged into the SDA file nor copied to the public part.


The build log should contain some lines like these:
[pppacker] Packed 1 file or entity my-external.jar (Archive/Java Library)

Your DC MetaData should look like this. The libs folder is added as source folder in the DC metadata and a build-time dependency to tc/bi/fct/extlib exists.


How does it work?

The DC tc/bi/fct/extlib provides an extension to the build plugin framework that adds special handling for a “libs” source folder. Effectively this extension creates an additional Ant build file and wraps the jar files from the libs folder into a public part structure and adds that internal public part to the build. The standard build process for the J2EE Server Component Library will just see an addtional public part that is packaged like any other used public part. For the developer in the developer studio no additional public part is visible.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Daniel Graversen
      Daniel Graversen
      I have always spend a long time adding external libraries to my software components. I home this will help.
      Author's profile photo Former Member
      Former Member
      very useful info
      Author's profile photo Former Member
      Former Member
      I tried to create the local folder (item 3) as "libraries" or "lib" and notice that it didn't works cause "provider.xml" file generated inside the "*.sda" file didn't have the references to "*.jar"s files. With "libs" it's Ok.
      Author's profile photo Marion Schlotte
      Marion Schlotte
      Blog Post Author
      Yes, that's right. The folder must be "libs". Kind regards, Marion
      Author's profile photo Former Member
      Former Member
      Congratulations! Amazing approach! But as of NW7.0 SP14 was installed and I've created an external library in described manner and there was no public part available for another DCs. Is it normal behavior? In my case all the DCs are Local Development Components. Does tc/bi/fct/extlib component applicable for NWDI only? The metadata of external library projects is the same as you had shown in the presentation and all the needed jars was included into the deployable sda of the project but the case of usage such external library with the other DCs is not possible. The reason is that the dependency to the external library was declared but DC is unable to resolve any classes from external library neither from 'Organize imports' nor from manual declaration
      Author's profile photo Former Member
      Former Member
      Same problem for me with 7.00.15.
      The J2EE lib was successfully deployed, contains the jars and could be referenced, but no entities available in the deflib PP. Therefore no design time dependencies possible which makes this feature less useful 🙁
      Author's profile photo Juan Janse
      Juan Janse
      Author's profile photo Former Member
      Former Member
      I tried to follow this recommendation but creation of a local 'libs' folder is not reflected in my NWDS. Here I still see the other folder types except for 'libs'.
      Any suggestions?


      Author's profile photo Former Member
      Former Member
      Hi I followed your steps
      1.Created J2EE/Library Project
      2.I put that DC in Used DC of my WebDynpro Dc.
      3 Wrote the code but it is not recognizing my Jar file(For ex JXL.Jar workbook cannot be resolved)

      Please give me some hints

      Thanks and Regards,

      Author's profile photo Former Member
      Former Member
      Nice blog. But even after following the steps we are still getting classpath error on building a Webdynpro DC.Incomplete classpath.
      Author's profile photo Marc Wirth
      Marc Wirth

      If you look at the build log of your WebDynpro DC the classpath of the generator should be logged. Do you see your Jar in that list?/lib/java/ folder if the build of the external library correctly put the Jar file into the public part.