Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
5.2. Class Sharing
Private class space 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
By default, a FAB adds each Maven dependency to its private class space at run time (except for dependencies having Maven group ID
org.apache.camel
, org.apache.activemq
, or org.apache.cxf
, which are shared by default). This is a safe approach to deploying dependencies, because it reduces the risk of version inconsistencies. But it is also an expensive approach, in terms of resources, because it forces the JVM to maintain a dedicated copy of each dependency in memory, just for this FAB.
Shared class space 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
You can make a FAB more economical by opting to share some of its dependencies with other applications in the container. There are two approaches you can use:
Specify shared dependencies using provided scope 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
To share a dependency (and its transitive dependencies), declare a dependency with the
provided
scope in your project's pom.xml
file. For example:
This is analogous to the approach you would use when building a WAR with Maven, in order to avoid including libraries like the servlet API or the JSP API.
Specify shared dependencies using Manifest header 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
You can also configure class sharing by setting the
FAB-Provided-Dependency:
manifest header. For example, to share all artifacts with the org.acme.foo
Maven group ID:
FAB-Provided-Dependency: org.acme.foo:* org.apache.camel:* org.apache.cxf:* org.apache.activemq:*
FAB-Provided-Dependency: org.acme.foo:* org.apache.camel:* org.apache.cxf:* org.apache.activemq:*
For full details of how to use this approach, see the section called “Sharing dependencies” and the section called “How to set JAR manifest headers”.