如何获取WebLogic 12.1.3.0提供的完整依赖清单?
Hey there! I’ve dealt with this exact frustration with WebLogic’s sparse public dependency docs before—let’s break down the reliable ways to find which dependencies you can safely mark as provided in your pom.xml:
1. Dig into WebLogic’s Local lib Directory
WebLogic ships with all the runtime dependencies it provides right on your server installation. Head to WL_HOME/wlserver/server/lib (replace WL_HOME with your WebLogic install path). Here are the most common ones you’ll want to mark as provided:
- Java EE 6 APIs: WebLogic 12.1.3 is Java EE 6 compliant, so APIs like
javax.servlet-api(3.0),javax.ejb-api(3.1),javax.persistence-api(2.0), andjavax.faces-api(2.1) are all included. - WebLogic-specific core libraries:
weblogic.jar(contains WebLogic’s proprietary APIs),wls-api.jar, andwlclient.jar(for client-side code, but if you’re deploying to the server, this is provided).
To get exact versions, pop open the META-INF/MANIFEST.MF inside any JAR using a command like:
jar -xf weblogic.jar META-INF/MANIFEST.MF && cat META-INF/MANIFEST.MF
Look for Implementation-Version or Specification-Version entries.
2. Use WebLogic’s Maven BOM (Bill of Materials)
Even if you found a partial pom, the official WebLogic BOM should have all managed dependency versions. Add this to your pom.xml’s dependencyManagement section to align your versions with what WebLogic provides:
<dependencyManagement> <dependencies> <dependency> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-server-bom</artifactId> <version>12.1.3-0-0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
Then, when adding dependencies like javax.servlet-api, just set <scope>provided</scope>—the BOM will handle the correct version automatically.
3. Check WebLogic’s Runtime Library Documentation
While Oracle’s search can be hit-or-miss, the Developing Applications for Oracle WebLogic Server guide has a section dedicated to runtime libraries. Look for the chapter on "Understanding WebLogic Server Application Classloading"—it lists all libraries that WebLogic provides to deployed apps, including both Java EE standards and WebLogic-specific tools.
4. Leverage Your IDE’s Server Integration
If you’re using IntelliJ IDEA or Eclipse, add WebLogic 12.1.3 as an application server in your IDE. Once linked to your project, the IDE will automatically flag dependencies that are already provided by the server, making it easy to set their scope to provided with just a few clicks.
The key takeaway: WebLogic’s local lib directory is your most concrete source of truth—if a JAR lives there, you can almost always mark its corresponding Maven dependency as provided.
内容的提问来源于stack exchange,提问作者MyWay

