VirtualWebappLoader or similar for WebLogic to add directories to war's classpath?

后端 未结 2 1422
别跟我提以往
别跟我提以往 2021-01-26 18:26

How can I make an external directory (where additional jars will be deployed) available on the classpath of a war deployed to WebLogic?

I am familiar with how to do this

相关标签:
2条回答
  • 2021-01-26 18:53

    Yes weblogic has the option to do this as well with virtual-directory-mapping inside weblogic.xml:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
      <virtual-directory-mapping>
        <local-path>C:\my\images</local-path>
        <url-pattern>*.jpg</url-pattern>
        <url-pattern>dir/*</url-pattern>
      </virtual-directory-mapping>
    </weblogic-web-app>
    

    See the Oracle docs here

    Other options to use jars outside of a war include installing the jar as a shared library or simply including the jar files inside of your <domain>/lib folder to make them available to all applications.

    0 讨论(0)
  • 2021-01-26 18:59

    You can create a file with name .beabuild.txt inside application's exploded directory and then map any directory or file to the application's directory.

    Example usage

    Let's assume we have Gradle multiproject build ExampleProject. Then .beabuild.txt could look like:

    C\:/Users/User/.gradle/caches/modules-2/files-2.1/asm/asm/1.5.3/63a2715c39c9e97f88fe371d4441a1b3493d74f9/asm-1.5.3.jar = APP-INF/lib/asm-1.5.3.jar
    C\:/Users/User/.gradle/caches/modules-2/files-2.1/asm/asm-all/2.2.3/9b79af5fc90f2dca349f16b771c21a43045f97ba/asm-all-2.2.3.jar = APP-INF/lib/asm-all-2.2.3.jar
    C\:/Users/repos/ExampleProject/ui/src/main/webapp = ui.war
    C\:/Users/repos/ExampleProject/ui/build/classes/main = ui.war/WEB-INF/classes
    C\:/Users/repos/ExampleProject/ui/build/resources/main = ui.war/WEB-INF/classes
    C\:/Users/repos/ExampleProject/common/build/classes/main = APP-INF/classes
    C\:/Users/repos/ExampleProject/common/build/resources/main = APP-INF/classes
    

    Creating a Split Development Directory Environment at docs.oracle.com

    0 讨论(0)
提交回复
热议问题