如何提供属性文件作为类路径

时间:2016-11-19 09:44:24

标签: java ant classpath axis2 simplehttpserver

我正在使用AXIS创建webservice并使用ANT脚本运行它。

<target if="jars.ok" depends="make.repo" name="start.server">
    <property name="port" value="7070"/>
        <java fork="true" classname="org.apache.axis2.transport.http.SimpleHTTPServer">
            <arg value="${build}/repo"/>
            <classpath refid="axis2.class.path"/>
            <arg value="-p${port}"/>
        </java>
    </target>

使用

设置类路径
<path id="axis2.class.path">
        <pathelement path="${java.class.path}"/>
        <pathelement path="${maven.class.path}"/>
        <fileset dir="${axis2.home}">
            <include name="lib/*.jar"/>
            <include name="resources/*.properties"/>
        </fileset>
    </path>

但我的错误是

    [java] log4j:WARN Please initialize the log4j system properly [SimpleHTTPServer] 

我需要做些什么才能解决这个问题,非常感谢

1 个答案:

答案 0 :(得分:1)

您不能将Property文件添加为classpath,只能添加文件夹和Jar文件。

所以这里包括整个资源文件夹:

pathelement path =“$ {axis2.home} / resources”

相关问题