从现有Ant构建文件导入项目时,缺少文件夹src

时间:2016-07-24 10:26:23

标签: eclipse ant src build.xml wso2cep

我已经使用Ant创建了一个Java项目,我想在eclipse中导入它。遵循一个简单的程序。

File-->New--->Java--->Java Project From Existing Build File

我选择了一个构建文件并选中了

Link to the existing build file in the system

它在Package Explorer中创建了一个项目文件夹,其中包含以下内容

  • java文件夹
  • 参考图书馆
  • 的build.xml

实际的java文件所在的src文件夹层次结构中没有。我的build.xml的内容是:

<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~     http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied.  See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->

<project default="run">

<property name="carbon.home" value="../../.."/>
<property name="src.dir" value="src/main/java"/>
<property name="resources.dir" value="src/main/resources"/>
<property name="temp.dir" value="temp"/>
<property name="lib.dir" value="../../lib"/>
<property name="class.dir" value="${temp.dir}/classes"/>
<property name="main-class" value="org.wso2.carbon.sample.http.Http"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>

<property name="url" value=""/>
<property name="sn" value=""/>
 <property name="filePath" value="&quot;&quot;"/>

<path id="javac.classpath">
    <pathelement path="${class.dir}"/>
    <fileset dir="${lib.dir}"/>
    <fileset dir="${carbon.home}/repository/components/plugins/">
        <include name="org.wso2.carbon.logging_*.jar"/>
        <include name="commons-pool_*.jar"/>
        <include name="httpclient_*.jar"/>
        <include name="httpcore_*.jar"/>
        <include name="commons-httpclient_*.jar"/>
        <include name="commons-codec_*.jar"/>
        <include name="slf4j.log4j12_1.7.12.jar"/>
        <include name="slf4j.api_1.7.12.jar"/>
        <include name="axis2_*.jar"/>
        <include name="axiom_*.jar"/>
        <include name="wsdl4j_*.jar"/>
        <include name="XmlSchema_*.jar"/>
        <include name="neethi_*.jar"/>
        <include name="org.wso2.securevault_*.jar"/>
        <include name="com.google.gson_*.jar"/>
        <include name="libthrift_*.jar"/>
    </fileset>
</path>


<target name="clean">
    <!--<delete dir="target" quiet="true"/>-->
    <delete dir="${class.dir}" quiet="true"/>
    <delete dir="${temp.dir}"/>
</target>

<target name="init">
    <mkdir dir="${temp.dir}"/>
    <mkdir dir="${class.dir}"/>
</target>

<target name="compile" depends="init">
    <javac srcdir="${src.dir}" destdir="${class.dir}" compiler="modern">
        <include name="*/**"/>
        <classpath refid="javac.classpath"/>
    </javac>
    <copy todir="${class.dir}" overwrite="true">
        <fileset dir="${resources.dir}">
            <include name="*.properties"/>
        </fileset>
    </copy>
</target>

<target name="run" depends="compile">
    <echo> Configure -Durl=xxxx and ( -DfilePath=xxxx or -Dsn='sample number') optionally use -Dusername=xxxx -Dpassword=xxxx </echo>
    <java classname="${main-class}"
          classpathref="javac.classpath" fork="true">
        <arg value="${url}"/>
        <arg value="${username}"/>
        <arg value="${password}"/>
        <arg value="${sn}"/>
        <arg value="${filePath}"/>
    </java>
</target>

</project>

它是wso2cep中http客户端的示例项目。请确定是否遗漏了什么?此外,我无法在eclipse中看到构建过程的进度,或者我是否尝试清理项目。

0 个答案:

没有答案