| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| // |
| |
| = DevFaqHowPackageLibraries |
| :jbake-type: wiki |
| :jbake-tags: wiki, devfaq, needsreview |
| :jbake-status: published |
| :keywords: Apache NetBeans wiki DevFaqHowPackageLibraries |
| :description: Apache NetBeans wiki DevFaqHowPackageLibraries |
| :toc: left |
| :toc-title: |
| :syntax: true |
| |
| === I need to package some third party libraries with my module. How do I do that? |
| |
| Generally if it's a third party library |
| (you didn't write it, you can't or don't want to change it), |
| you will want to use a wrapper module (see link:DevFaqWrapperModules.asciidoc[DevFaqWrapperModules]). |
| An NBM file (a module packaged for delivery over the net) |
| can contain more than one JAR, |
| so all your libraries can be included in a single file that packages your module. |
| |
| Note you can multi-select JARs in the New Library Wrapper Module wizard. |
| |
| Since NetBeans 6.8 you can add, remove and assign sources and Javadoc to wrapped libraries in Project Properties dialog, Libraries / Wrapped JARs tab. |
| |
| ==== Advanced stuff |
| |
| Before NB 6.8 you _could_ add libraries manually to a standard module; |
| or add additional libraries to an existing library wrapper module. |
| The relevant data is in the `project.xml` for the module. |
| What you would do is add entries similar to this one for each JAR. |
| |
| [source,xml] |
| ---- |
| |
| <class-path-extension> |
| <runtime-relative-path>ext/hexedit.jar</runtime-relative-path> |
| <binary-origin>release/modules/ext/hexedit.jar</binary-origin> |
| </class-path-extension> |
| ---- |
| |
| Note if you want these libraries to be usable outside of the module they're declared in, |
| then you must add the relevant packages to the list of public packages for that module. |
| |
| <hr/> |
| Applies to: NetBeans 6.8 and later |
| |
| == See also |
| |
| * link:PackagingADistributableJavaApp.asciidoc[Packaging A Distributable Java App] |
| * link:DevFaqHowPackageLibraries_DE.asciidoc[German version] |
| |
| === Apache Migration Information |
| |
| The content in this page was kindly donated by Oracle Corp. to the |
| Apache Software Foundation. |
| |
| This page was exported from link:http://wiki.netbeans.org/DevFaqHowPackageLibraries[http://wiki.netbeans.org/DevFaqHowPackageLibraries] , |
| that was last modified by NetBeans user Jglick |
| on 2010-06-11T20:07:20Z. |
| |
| |
| *NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed. |