Bonjour, je débute avec java ee et maven.
J'essaye de faire un .jar avec maven selon l'exemple du livre java ee 6 et glassfish 3, chapitre 6. Les sources sont dispos à l'adresse http://kenai.com/projects/beginninge...runk/chapter06

voici mon pom.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
<?xml version="1.0" encoding="UTF-8"?>
<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.beginningee6.book</groupId>
    <artifactId>chapter06</artifactId>
    <packaging>jar</packaging>
    <version>2.0</version>
    <name>Chapter 06 - EJB</name>
 
        <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>${javax.persistence-version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>${eclipselink-version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
            <version>${glassfish-version}</version>
        </dependency>
    </dependencies>
    <!--To avoid multiple modules with Maven, here is what you need to manually do (it's not nice, but it works)
    1) Comment the following section (maven-jar-plugin), package the jar, and deploy to GlassFish
    2) Uncomment the following section, package the jar and run the Main class with app client --> 
  <!--  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${plugin-jar-version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.beginningee6.book.chapter06.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build> -->
 
</project>

Et l'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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
 
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Chapter 06 - EJB
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 1 resource
Downloading: http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persist
ence/${javax.persistence-version}/javax.persistence-${javax.persistence-version}
.pom
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:pom:${
javax.persistence-version}' in repository central (http://repo1.maven.org/maven2
)
Downloading: http://repo1.maven.org/maven2/org/eclipse/persistence/eclipselink/$
{eclipselink-version}/eclipselink-${eclipselink-version}.pom
[INFO] Unable to find resource 'org.eclipse.persistence:eclipselink:pom:${eclips
elink-version}' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/glassfish/extras/glassfish-embedd
ed-all/${glassfish-version}/glassfish-embedded-all-${glassfish-version}.pom
[INFO] Unable to find resource 'org.glassfish.extras:glassfish-embedded-all:pom:
${glassfish-version}' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persist
ence/${javax.persistence-version}/javax.persistence-${javax.persistence-version}
.jar
Downloading: http://repo1.maven.org/maven2/org/glassfish/extras/glassfish-embedd
ed-all/${glassfish-version}/glassfish-embedded-all-${glassfish-version}.jar
[INFO] Unable to find resource 'org.eclipse.persistence:javax.persistence:jar:${
javax.persistence-version}' in repository central (http://repo1.maven.org/maven2
)
Downloading: http://repo1.maven.org/maven2/org/eclipse/persistence/eclipselink/$
{eclipselink-version}/eclipselink-${eclipselink-version}.jar
[INFO] Unable to find resource 'org.eclipse.persistence:eclipselink:jar:${eclips
elink-version}' in repository central (http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'org.glassfish.extras:glassfish-embedded-all:jar:
${glassfish-version}' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
 
Missing:
----------
1) org.eclipse.persistence:javax.persistence:jar:${javax.persistence-version}
 
  Try downloading the file manually from the project website.
 
  Then, install it using the command:
      mvn install:install-file -DgroupId=org.eclipse.persistence -DartifactId=ja
vax.persistence -Dversion=${javax.persistence-version} -Dpackaging=jar -Dfile=/p
ath/to/file
 
  Alternatively, if you host your own repository you can deploy the file there:
 
      mvn deploy:deploy-file -DgroupId=org.eclipse.persistence -DartifactId=java
x.persistence -Dversion=${javax.persistence-version} -Dpackaging=jar -Dfile=/pat
h/to/file -Durl=[url] -DrepositoryId=[id]
 
  Path to dependency:
        1) org.beginningee6.book:chapter06:jar:2.0
        2) org.eclipse.persistence:javax.persistence:jar:${javax.persistence-ver
sion}
 
2) org.eclipse.persistence:eclipselink:jar:${eclipselink-version}
 
  Try downloading the file manually from the project website.
 
  Then, install it using the command:
      mvn install:install-file -DgroupId=org.eclipse.persistence -DartifactId=ec
lipselink -Dversion=${eclipselink-version} -Dpackaging=jar -Dfile=/path/to/file
 
  Alternatively, if you host your own repository you can deploy the file there:
 
      mvn deploy:deploy-file -DgroupId=org.eclipse.persistence -DartifactId=ecli
pselink -Dversion=${eclipselink-version} -Dpackaging=jar -Dfile=/path/to/file -D
url=[url] -DrepositoryId=[id]
 
  Path to dependency:
        1) org.beginningee6.book:chapter06:jar:2.0
        2) org.eclipse.persistence:eclipselink:jar:${eclipselink-version}
 
3) org.glassfish.extras:glassfish-embedded-all:jar:${glassfish-version}
 
  Try downloading the file manually from the project website.
 
  Then, install it using the command:
      mvn install:install-file -DgroupId=org.glassfish.extras -DartifactId=glass
fish-embedded-all -Dversion=${glassfish-version} -Dpackaging=jar -Dfile=/path/to
/file
 
  Alternatively, if you host your own repository you can deploy the file there:
 
      mvn deploy:deploy-file -DgroupId=org.glassfish.extras -DartifactId=glassfi
sh-embedded-all -Dversion=${glassfish-version} -Dpackaging=jar -Dfile=/path/to/f
ile -Durl=[url] -DrepositoryId=[id]
 
  Path to dependency:
        1) org.beginningee6.book:chapter06:jar:2.0
        2) org.glassfish.extras:glassfish-embedded-all:jar:${glassfish-version}
 
----------
3 required artifacts are missing.
 
for artifact:
  org.beginningee6.book:chapter06:jar:2.0
 
from the specified remote repositories:
  central (http://repo1.maven.org/maven2)
 
 
 
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Sat Oct 09 19:04:04 CEST 2010
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
C:\eclipse-jee\workspace\chapter06>
Merci de votre aide, je ne peux plus avancer dans le livre si je n'arrive même pas à compiler...