Bonjour. Je suis développeur de niveau intermédiaire en java et je n'ai commencé à utiliser maven que cette année dans un grand projet. j'ai doncc dans mon projet codé mes classes métiers dans un module et ma couche dao dans un autre. une fois venu le momlent de tester et voir si ma dao fonctionne ça ne marche pas. compte tenu du fait que j'utilise jpa comme moyen de persistance. je sollicite de l'aide pour me sortir de ce type de message erreur:
voici le code qui génère cette erreur:
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 private static FormadanUserDao getInstance(){ if(dao == null) { dao = new FormadanUserDaoImpl(FormadanUser.class); } return dao; } public static void main(String[] rags){ FormadanUser user = new FormadanUser(); user.setFirstName("Steve"); user.setLastName("stealon"); user.setDateOfBirth(LocalDate.of(1945, 9, 9)); user.setSexe(Sexe.MASCULIN); user.setIdCardNumber(298654785); user.setPlaceOfBirth("Yaoundé"); user.setNature(Nature.PHYSICAL_PERSON); user.setDateOfCreation(LocalDate.now()); user.setLogin("Stealon"); user.setPassword("dj,bd@h"); EntityManagerFactory emf = Persistence.createEntityManagerFactory("formadan-persistence-unit"); EntityManager em = emf.createEntityManager(); dao = getInstance(); dao.setEntityManager(em); EntityTransaction t = em.getTransaction(); try{ t.begin(); dao.create(user); t.commit(); }catch(Exception e){ t.rollback(); }finally{ em.close(); } }Merci à tous.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 Failed to execute goal on project formadan-dao: Could not resolve dependencies for project com.life-surf:formadan-dao:jar:1.0-SNAPSHOT: Failed to collect dependencies for [org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final (compile), com.life-surf:formadan-model:jar:1.0-SNAPSHOT (compile)]: Failed to read artifact descriptor for com.life-surf:formadan-model:jar:1.0-SNAPSHOT: Could not find artifact com.life-surf:Formadan:pom:1.0-SNAPSHOT -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging. For more information about the errors and possible solutions, please read the following articles: [Help 1] <a href="http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException" target="_blank">http://cwiki.apache.org/confluence/d...utionException</a>
Partager