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

Maven Java Discussion :

Problème de dépendence Maven


Sujet :

Maven Java

  1. #1
    Membre habitué
    Inscrit en
    Février 2013
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Février 2013
    Messages : 10
    Par défaut Problème de dépendence Maven
    Bonjour,

    Je travaille avec un tutoriel pour Hibernate :http://docs.jboss.org/hibernate/orm/.../tutorial.html

    Après avoir installé JBoss et Eclipse Juno, je me suis mis à construire l'arborescence (cf. l'image attachée), à laquelle j'ai ajouté le fichier hibernate-core.jar, sans oublier de l'intégrer dans le "build path". Le problème est que si je veux démarrer le fichier pom.xml comme "maven build" ("run as maven build"), il y a toujours les erreurs suivantes:
    [INFO] Scanning for projects...
    [ERROR] The build could not read 1 project -> [Help 1]
    [ERROR]
    [ERROR] The project org.hibernate.tutorials:hibertut:1.0.0-SNAPSHOT (C:\Users\MON_NOM\workspace\hibertut\src\main\java\pom.xml) has 4 errors
    [ERROR] 'dependencies.dependency.version' for org.hibernate:hibernate-core:jar is missing. @ line 18, column 21
    [ERROR] 'dependencies.dependency.version' for javax.servlet:servlet-api:jar is missing. @ line 24, column 21
    [ERROR] 'dependencies.dependency.version' for org.slf4j:slf4j-simple:jar is missing. @ line 30, column 21
    [ERROR] 'dependencies.dependency.version' for javassist:javassist:jar is missing. @ line 36, column 21
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...ldingException
    Pourquoi dit-il que la dépendance de hibernate-core n'existe pas ?

    Voici mon pom.xml
    Code XML : 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
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     
        <modelVersion>4.0.0</modelVersion>
     
        <groupId>org.hibernate.tutorials</groupId>
        <artifactId>hibertut</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <name>First Hibernate Tutorial</name>
     
        <build>
             <!-- we dont want the version to be part of the generated war file name -->
             <finalName>${artifactId}</finalName>
        </build>
     
        <dependencies>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
            </dependency>
     
            <!-- Because this is a web app, we also have a dependency on the servlet api. -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </dependency>
     
            <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
            </dependency>
     
            <!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
            <dependency>
                <groupId>javassist</groupId>
                <artifactId>javassist</artifactId>
            </dependency>
        </dependencies>
     
    </project>
    Merci d'avance pour votre aide.
    Images attachées Images attachées  

  2. #2
    Membre chevronné
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    251
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2011
    Messages : 251
    Par défaut
    L'exception te signifie qu'il faut que tu précises la version des dépendances.
    Par exemple:
    Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                 <version>4.2.0</version>
            </dependency>

  3. #3
    Membre habitué
    Inscrit en
    Février 2013
    Messages
    10
    Détails du profil
    Informations forums :
    Inscription : Février 2013
    Messages : 10
    Par défaut
    Merci!

Discussions similaires

  1. Problème de dépendence javax.mail
    Par lahmar.abdel1 dans le forum Maven
    Réponses: 3
    Dernier message: 10/06/2010, 13h15
  2. Problème de dépendence pour python 2.5.1
    Par djib'Z dans le forum Déploiement/Installation
    Réponses: 4
    Dernier message: 16/04/2010, 11h01
  3. gestion des dépendences maven
    Par javadevelopper dans le forum Maven
    Réponses: 1
    Dernier message: 21/01/2010, 12h16
  4. Problème d'installation maven
    Par Nertios dans le forum Maven
    Réponses: 0
    Dernier message: 02/06/2009, 16h49
  5. MultiModules et problèmes de dépendences
    Par Frederik dans le forum Maven
    Réponses: 13
    Dernier message: 11/10/2007, 19h02

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