Bonjour;
voici l'arborescence du mon projet;
Pièce jointe 149424
je cherche le fichier équivalant à index.html d'un site web classique?
où je dois commencer.
Merci.
Version imprimable
Bonjour;
voici l'arborescence du mon projet;
Pièce jointe 149424
je cherche le fichier équivalant à index.html d'un site web classique?
où je dois commencer.
Merci.
Bonjour,
Ta question n'est pas très claire.
Maven est un outil permettant de construire une application Java (généralement). Le répertoire que tu nous montres, target, est le répertoire de construction utilisé par Maven. Autrement dit, quand Maven compile les sources du projet, c'est là où il va tout mettre.
Bref, que souhaites-tu savoir au juste ?
fait voir le contenu de ton pom.xml, ca permettra d'aider à répondre. Le contenu du fichier assembly présent dans src/assemble pourrais être pas mal utile aussi.
Code:
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 <?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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.xwiki.enterprise</groupId> <artifactId>xwiki-enterprise-jetty</artifactId> <version>5.4.5</version> </parent> <artifactId>xwiki-enterprise-jetty-hsqldb</artifactId> <name>XWiki Enterprise - Distribution - Jetty - HSQLDB</name> <packaging>pom</packaging> <description>XWiki Enterprise - Distribution - Jetty - HSQLDB</description> <dependencies> <dependency> <groupId>org.xwiki.enterprise</groupId> <artifactId>xwiki-enterprise-data-hsqldb</artifactId> <version>${project.version}</version> <type>zip</type> <optional>true</optional> </dependency> </dependencies> <build> <plugins> <!-- Inject Hibernate's configuration for the specified database --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-remote-resources-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> <descriptor>src/assemble/application.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> </project>
Code:
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 <assembly> <id>distribution</id> <formats> <format>zip</format> </formats> <includeBaseDirectory>true</includeBaseDirectory> <dependencySets> <!-- "xwiki" webapp. --> <dependencySet> <includes> <include>org.xwiki.enterprise:xwiki-enterprise-web</include> </includes> <outputDirectory>webapps/xwiki</outputDirectory> <unpack>true</unpack> <unpackOptions> <excludes> <exclude>**/hibernate.cfg.xml</exclude> </excludes> </unpackOptions> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> <!-- ROOT webapp, redirecting to /xwiki/ when no application is specified. --> <dependencySet> <includes> <include>org.xwiki.platform:xwiki-platform-tool-rootwebapp</include> </includes> <outputDirectory>webapps/root</outputDirectory> <unpack>true</unpack> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> <!-- Unpack Jetty files Note1: We need to apply filtering to resolve the "xwikiDataDir" property in start shell scripts. Note2: Since the Assembly plugin doesn't allow us to specify which files should be filtered we need two definitions, one with only start shell scripts and one without them. --> <dependencySet> <includes> <include>org.xwiki.platform:xwiki-platform-tool-jetty-resources</include> </includes> <outputDirectory>/</outputDirectory> <unpack>true</unpack> <!-- TODO: This shouldn't be needed but there's a bug see <a href="http://jira.codehaus.org/browse/MASSEMBLY-554" target="_blank">http://jira.codehaus.org/browse/MASSEMBLY-554</a> --> <outputFileNameMapping>/</outputFileNameMapping> <unpackOptions> <filtered>true</filtered> <includes> <include>**/start_xwiki*.*</include> </includes> </unpackOptions> <!-- Extracting some resources from the dependency somehow looses the file permissions, so we need to set them again so that the start xwiki scripts are executable... --> <fileMode>755</fileMode> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> <dependencySet> <includes> <include>org.xwiki.platform:xwiki-platform-tool-jetty-resources</include> </includes> <outputDirectory>/</outputDirectory> <unpack>true</unpack> <!-- TODO: This shouldn't be needed but there's a bug see <a href="http://jira.codehaus.org/browse/MASSEMBLY-554" target="_blank">http://jira.codehaus.org/browse/MASSEMBLY-554</a> --> <outputFileNameMapping>/</outputFileNameMapping> <unpackOptions> <filtered>false</filtered> <excludes> <exclude>**/start_xwiki*.*</exclude> </excludes> </unpackOptions> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> <!-- Add JDBC driver for the database to use. --> <dependencySet> <includes> <include>${xwiki.db.jdbc.groupId}:${xwiki.db.jdbc.artifactId}</include> </includes> <outputDirectory>webapps/xwiki/WEB-INF/lib</outputDirectory> <unpack>false</unpack> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> <!-- Unpack the data files to package it in the distribution --> <dependencySet> <includes> <include>org.xwiki.enterprise:xwiki-enterprise-data-${xwiki.db}</include> </includes> <outputDirectory>/${xwikiDataDir}/</outputDirectory> <unpack>true</unpack> <!-- Needed to prevent warning since our project has a pom packaging and is not producing any artifact --> <useProjectArtifact>false</useProjectArtifact> </dependencySet> </dependencySets> <!-- Add Hibernate configuration file --> <files> <file> <source>${basedir}/target/maven-shared-archive-resources/hibernate.cfg.xml</source> <outputDirectory>webapps/xwiki/WEB-INF</outputDirectory> </file> </files> <!-- Add License/Notice files --> <fileSets> <fileSet> <directory>${basedir}/target/maven-shared-archive-resources/META-INF</directory> <outputDirectory>META-INF</outputDirectory> </fileSet> </fileSets> </assembly>
Bon, pour débuter, t'es pas partis sur du facile du tout :mrgreen: Et au fait, pour faciliter le travail, il y a des balises code sur le forum ^^
Alors, que trouve-t-on dans ton pom?
Premièrement, ceci:
dit que ton projet n'est pas une application, ni une webapp. Il ne fait aucune compilation non plus. C'est un projet non-java en somme. En général on s'en sert comme projet de configuration, projet parent à d'autre, etc. Bref, il ne fait pas grand chose. Ce qu'il fait, c'est ceci, principalement:Code:<packaging>pom</packaging>
utiliser le projet wiki-enterprise-data-hsqldb (via le dependency)
utiliser le plugin assembly, via le fichier application.xml:
Code:
1
2
3
4
5
6
7
8
9 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> <descriptor>src/assemble/application.xml</descriptor> </descriptors> </configuration> </plugin>
Que fait ce application.xml? Il dit:
On va générer un zip
Code:<format>zip</format>
Code:
1
2
3
4 <includes> <include>org.xwiki.enterprise:xwiki-enterprise-web</include> </includes> <outputDirectory>webapps/xwiki</outputDirectory>
qui contient le contenu du projet xwiki-enterprise-web dans son répertoire webapps/xwiki
Sauf la configuration hibernateCode:
1
2
3 <excludes> <exclude>**/hibernate.cfg.xml</exclude> </excludes>
pareil avec le projet rootCode:
1
2
3
4 <includes> <include>org.xwiki.platform:xwiki-platform-tool-rootwebapp</include> </includes> <outputDirectory>webapps/root</outputDirectory>
et on récupère une installation de jetty toute prête qu'on extrait à la racineCode:
1
2
3
4 <includes> <include>org.xwiki.platform:xwiki-platform-tool-jetty-resources</include> </includes> <outputDirectory>/</outputDirectory>
etc...
on ajoute des drivers spécifiques à la base de données choisieCode:
1
2
3
4 <includes> <include>${xwiki.db.jdbc.groupId}:${xwiki.db.jdbc.artifactId}</include> </includes> <outputDirectory>webapps/xwiki/WEB-INF/lib</outputDirectory>
Et des données spécifiques à cette base (probablement les scripts d'initialisation de la base)Code:
1
2
3 <includes> <include>org.xwiki.enterprise:xwiki-enterprise-data-${xwiki.db}</include> </includes>
Pour répondre à ta question initiale, ce qui est affiché quand tu tapes localhost:8080/xwiki, c'est ce qui a été préparer dans l'autre projet, org.xwiki.enterprise:xwiki-enterprise-web ;)
tu es un expert.
merci.
et à la prochaine question.