【问题标题】:WLST ant task not finding classpathrefWLST ant 任务未找到 classpathref
【发布时间】:2017-03-01 20:21:36
【问题描述】:

我正在尝试使用 wlst 进行本地 weblogic 部署。我创建了一个 build.xml、build.properties 文件和一个简单的 wlst 脚本。我已经从命令行测试了脚本,它运行良好。但是,我很难从我的 ant 文件中执行它。

构建.xml

<project default="ListLibraries" name="WLST project">
<property file="build.properties" />

<taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" classpathref="${weblogic.classpath.id}" />

  <target name="ListLibraries">
      <wlst fileName="${wlst.script.source}/ListLibraries.py" classpathref="${weblogic.classpath.id}" />
  </target>

</project>

build.properties

# Weblogic specific dirs
weblogic.home.dir=/Users/me/Oracle/Middleware/wlserver_10.3
weblogic.bin.dir=${weblogic.home.dir}/common/bin
weblogic.lib.dir=${weblogic.home.dir}/server/lib
weblogic.classpath.id=${weblogic.lib.dir}/weblogic.jar

#workspace dirs
wlst.script.source=/Users/me/workspaces/python/wls_config

这是我看到的:

$ ant Buildfile: /Users/me/workspaces/java/myarrow/local/build.xml

BUILD FAILED /Users/me/workspaces/java/myarrow/local/build.xml:4: Reference /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar not found.

Total time: 0 seconds

Blockquote

但是,那个 weblogic.jar 确实存在:

$ ls -la /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
-rwxrwxrw-  1 a84055  my\Domain Users  36339849 Feb 13 15:45 /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

我在这里缺少什么?它可能就在我眼前。

【问题讨论】:

    标签: java ant weblogic wlst


    【解决方案1】:

    classpathref 期望引用路径,而不是物理路径。尝试改用classpath

    <taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" 
                         classpath="${weblogic.classpath.id}" />
    

    有关使用这两个属性的示例,请参阅 https://ant.apache.org/manual/Tasks/typedef.html

    使用classpathref,您需要先创建一个引用:

    <path id="weblogic.lib.path">
      <fileset file="${weblogic.classpath.id}"/>
    </path>
    
    <taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" 
                         classpathref="weblogic.lib.path" />
    

    【讨论】:

    • 你是我的救星!谢谢!
    猜你喜欢
    • 2012-04-04
    • 2019-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-17
    • 1970-01-01
    • 2013-07-08
    相关资源
    最近更新 更多