IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ANT Java Discussion :

BUILD FAILED Target "build.xml" does not exist in the project


Sujet :

ANT Java

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut BUILD FAILED Target "build.xml" does not exist in the project
    Bonjour,

    J'ai un script qui tourne très bien sour Eclipse et pour certaines raisons je veux qu'il redémarre régulièrement.
    Le problème c'est qu'il y a plein de librairies et que j'ai des tonnes de conflits dans la manifest quand je l'exporte avec JAR ou Runnable JAR.
    Du coup j'aimerais bien utiliser ce qu'eclipse utilise pour le lancer et donc ANT sur le build.xml créé par Eclipse pour le projet.

    Mais je ne sais pas pourquoi ça me met une drole d'erreur "Target "build.xml" does not exist" alors que le fichier build.xml est bien là


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>ant build.xml
    Buildfile: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\build.xml
     
    BUILD FAILED
    Target "build.xml" does not exist in the project "CERFAextraction".
     
    Total time: 0 seconds
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>echo %JAVA_HOME%
    C:\Program Files\Java\jdk1.8.0_31
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>echo %ANT_HOME%
    C:\Program Files\Java\apache-ant-1.9.5
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>echo %PATH%
    C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shar
    ed\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Liv
    e;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x
    86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\W
    indowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Stat
    ic;C:\Program Files (x86)\Calibre2\;c:\Program Files (x86)\Microsoft SQL Server\
    100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program
     Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Windows Live\Sh
    ared;C:\Program Files (x86)\MySQL\MySQL Utilities 1.4.3\;C:\Program Files (x86)\
    MySQL\MySQL Utilities 1.4.3\Doctrine extensions for PHP\;C:\Program Files (x86)\
    AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performa
    nce Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Fi
    les (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\1
    20\Tools\Binn\;C:\Program Files (x86)\Pinnacle\Shared Files\;C:\Program Files\Ja
    va\jdk1.8.0_31\bin;C:\Program Files\Java\apache-ant-1.9.5\bin;
    build.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- WARNING: Eclipse auto-generated file.
                  Any modifications will be overwritten.
                  To include a user specific buildfile here, simply create one in the same
                  directory with the processing instruction <?eclipse.ant.import?>
                  as the first entry and export the buildfile again. --><project basedir="." default="build" name="CERFAextraction">
        <property environment="env"/>
        <property name="ECLIPSE_HOME" value="../../../../../Program Files (x86)/eclipse/"/>
        <property name="debuglevel" value="source,lines,vars"/>
        <property name="target" value="1.7"/>
        <property name="source" value="1.7"/>
        <path id="CERFAextraction.classpath">
            <pathelement location="bin"/>
            <pathelement location="lib/java-sizeof-0.0.2.jar"/>
            <pathelement location="lib/jsoup-1.7.3.jar"/>
            <pathelement location="lib/httpclient-4.3.1.jar"/>
            <pathelement location="lib/httpcore-4.3.jar"/>
            <pathelement location="lib/httpmime-4.3.1.jar"/>
            <pathelement location="lib/httpclient-cache-4.3.1.jar"/>
            <pathelement location="lib/fluent-hc-4.3.1.jar"/>
            <pathelement location="lib/commons-logging-1.1.3.jar"/>
            <pathelement location="lib/commons-codec-1.6.jar"/>
            <pathelement location="lib/microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar"/>
            <pathelement location="lib/groovy-all-2.4.0.jar"/>
            <pathelement location="lib/ij.jar"/>
            <pathelement location="lib/commons-beanutils-1.9.1.jar"/>
            <pathelement location="lib/commons-io-2.4.jar"/>
            <pathelement location="lib/ghost4j-0.5.1.jar"/>
            <pathelement location="lib/itext-2.1.7.jar"/>
            <pathelement location="lib/jai_imageio.jar"/>
            <pathelement location="lib/jna.jar"/>
            <pathelement location="lib/junit-4.10.jar"/>
            <pathelement location="lib/xmlgraphics-commons-1.5.jar"/>
            <pathelement location="dist/tess4j.jar"/>
            <pathelement location="lib/DJNativeSwing-SWT.jar"/>
            <pathelement location="lib/DJNativeSwing.jar"/>
            <pathelement location="lib/swt-4.3-32bit-win32-win32-x86.jar"/>
            <pathelement location="lib/log4j-1.2.17.jar"/>
        </path>
        <target name="init">
            <mkdir dir="bin"/>
            <copy includeemptydirs="false" todir="bin">
                <fileset dir="src">
                    <exclude name="**/*.launch"/>
                    <exclude name="**/*.java"/>
                </fileset>
            </copy>
        </target>
        <target name="clean">
            <delete dir="bin"/>
        </target>
        <target depends="clean" name="cleanall"/>
        <target depends="build-subprojects,build-project" name="build"/>
        <target name="build-subprojects"/>
        <target depends="init" name="build-project">
            <echo message="${ant.project.name}: ${ant.file}"/>
            <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
                <src path="src"/>
                <classpath refid="CERFAextraction.classpath"/>
            </javac>
        </target>
        <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
        <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
            <copy todir="${ant.library.dir}">
                <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
            </copy>
            <unzip dest="${ant.library.dir}">
                <patternset includes="jdtCompilerAdapter.jar"/>
                <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
            </unzip>
        </target>
        <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
            <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
            <antcall target="build"/>
        </target>
        <target name="CERFA extraction elections pro">
            <java classname="netsur2.MegaImporter" failonerror="true" fork="yes">
                <classpath refid="CERFAextraction.classpath"/>
            </java>
        </target>
    </project>

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    la commande c'est "ant" et pas "ant build.xml"

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    676
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 676
    Points : 121
    Points
    121
    Par défaut
    Merci mais ça c'est pour faire le bulid et ça marche.
    Mais moi je voudrais lancer l'application

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>ant
    Buildfile: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\build.xml
     
    build-subprojects:
     
    init:
     
    build-project:
         [echo] CERFAextraction: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\bu
    ild.xml
     
    build:
     
    BUILD SUCCESSFUL
    Total time: 0 seconds
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>ant execute
    Buildfile: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\build.xml
     
    BUILD FAILED
    Target "execute" does not exist in the project "CERFAextraction".
     
    Total time: 0 seconds
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>ant -verbose
    Apache Ant(TM) version 1.9.5 compiled on May 31 2015
    Trying the default build file: build.xml
    Buildfile: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\build.xml
    Detected Java version: 1.8 in: C:\Program Files\Java\jdk1.8.0_31\jre
    Detected OS: Windows 7
    parsing buildfile C:\Users\Admin\Desktop\Logiciels\CERFAextraction\build.xml wit
    h URI = file:/C:/Users/Admin/Desktop/Logiciels/CERFAextraction/build.xml
    Project base dir set to: C:\Users\Admin\Desktop\Logiciels\CERFAextraction
    parsing buildfile jar:file:/C:/Program%20Files/Java/apache-ant-1.9.5/lib/ant.jar
    !/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/Java/a
    pache-ant-1.9.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
     [property] Loading Environment env.
    Build sequence for target(s) `build' is [build-subprojects, init, build-project,
     build]
    Complete build sequence is [build-subprojects, init, build-project, build, init-
    eclipse-compiler, CERFA extraction elections pro, clean, cleanall, build-refproj
    ects, build-eclipse-compiler, ]
     
    build-subprojects:
     
    init:
        [mkdir] Skipping C:\Users\Admin\Desktop\Logiciels\CERFAextraction\bin becaus
    e it already exists.
         [copy] No sources found.
     
    build-project:
         [echo] CERFAextraction: C:\Users\Admin\Desktop\Logiciels\CERFAextraction\bu
    ild.xml
        [javac] netsur2\BDD.java omitted as C:\Users\Admin\Desktop\Logiciels\CERFAex
    traction\bin\netsur2\BDD.class is up to date.
        [javac] netsur2\Chargeur.java omitted as C:\Users\Admin\Desktop\Logiciels\CE
    RFAextraction\bin\netsur2\Chargeur.class is up to date.
        [javac] netsur2\CrawlerUrl.java omitted as C:\Users\Admin\Desktop\Logiciels\
    CERFAextraction\bin\netsur2\CrawlerUrl.class is up to date.
        [javac] netsur2\Fc.java omitted as C:\Users\Admin\Desktop\Logiciels\CERFAext
    raction\bin\netsur2\Fc.class is up to date.
        [javac] netsur2\MegaImporter.java omitted as C:\Users\Admin\Desktop\Logiciel
    s\CERFAextraction\bin\netsur2\MegaImporter.class is up to date.
        [javac] netsur2\SimpleCrawler.java omitted as C:\Users\Admin\Desktop\Logicie
    ls\CERFAextraction\bin\netsur2\SimpleCrawler.class is up to date.
        [javac] netsur2\WinRegistry.java omitted as C:\Users\Admin\Desktop\Logiciels
    \CERFAextraction\bin\netsur2\WinRegistry.class is up to date.
     
    build:
     
    BUILD SUCCESSFUL
    Total time: 0 seconds
     
    C:\Users\Admin\Desktop\Logiciels\CERFAextraction>

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
        <target name="CERFA extraction elections pro">
            <java classname="netsur2.MegaImporter" failonerror="true" fork="yes">
                <classpath refid="CERFAextraction.classpath"/>
            </java>
        </target>
    Elle est là ta cible, mais tu ferais bien de la renommer, c'est le genre de machin galère à tapper en ligne de commande

Discussions similaires

  1. Réponses: 4
    Dernier message: 24/08/2011, 18h33
  2. The name 'AdressFamily' does not exist in the current context
    Par konamine dans le forum Windows Forms
    Réponses: 1
    Dernier message: 26/10/2008, 16h49
  3. Réponses: 9
    Dernier message: 11/09/2007, 18h17
  4. FATAL 1: Database "x" does not exist in the syste
    Par barbituric dans le forum PostgreSQL
    Réponses: 11
    Dernier message: 17/03/2004, 06h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo