pom.xml 13.3 KB
Newer Older
naji's avatar
naji committed
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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>api-pastis</artifactId>
        <groupId>fr.gouv.vitamui</groupId>
        <version>5.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>pastis-standalone</artifactId>
    <description>Pastis Standalone Version</description>

    <properties>
        <maven.compile.target>11</maven.compile.target>
        <maven.compile.source>11</maven.compile.source>
        <java.version>11</java.version>
        <angular.base.href>/</angular.base.href>
        <angular.build.project>pastis</angular.build.project>
        <rpm.skip>false</rpm.skip>
        <sonar.sources>src/main/java</sonar.sources>
        <swagger.dir>ui</swagger.dir>
        <swagger.skip>false</swagger.skip>
        <webpack.skip>false</webpack.skip>
        <webpack.test.skip>false</webpack.test.skip>
        <skipAllFrontend>false</skipAllFrontend>
        <skipAllFrontendTests>false</skipAllFrontendTests>
    </properties>


    <dependencies>
        <dependency>
            <groupId>fr.gouv.vitam</groupId>
            <artifactId>common-public</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>fr.gouv.vitamui</groupId>
            <artifactId>pastis</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>pastis-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui.commons</groupId>
                    <artifactId>commons-rest</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui.commons</groupId>
                    <artifactId>commons-vitam</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>security-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>iam-internal-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>iam-security</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-webflux</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-actuator</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-configuration-processor</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-starter-consul-discovery</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-security</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-test</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>iam-commons</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>iam-external-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>fr.gouv.vitamui.commons</groupId>
                    <artifactId>commons-test</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>${jsonassert.version}</version>
            <scope>compile</scope>
        </dependency>
descamps's avatar
descamps committed
118
119
120
        <!--        Dans Java SE 9 et 10, la classe JAXB n'est plus présente dans la variable "classpath" par défaut.
                A partir de la version 11, elle a complètement disparu de Java en édition standard.
                Obliger de préciser une version antérieur pour éviter un NoClassDefFoundError à ce niveau-->
naji's avatar
naji committed
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

        <!-- Documentation -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>build-info</goal>
                        </goals>
                    </execution>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>true</executable>
                    <attach>false</attach> <!-- Need to use the original jar for integration-tests -->
                    <mainClass>fr.gouv.vitamui.pastis.standalone.ApiPastisStandaloneApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>standalone</id>
            <dependencies>
                <dependency>
                    <groupId>fr.gouv.vitamui</groupId>
                    <artifactId>ui-frontend</artifactId>
                    <scope>provided</scope>
                    <type>pom</type>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
            <build>
                <resources>
                    <resource>
                        <directory>target/www/</directory>
                        <targetPath>static/</targetPath>
                    </resource>
                    <resource>
                        <directory>src/main/resources</directory>
                    </resource>
                </resources>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                        <filtering>true</filtering>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
unknown's avatar
unknown committed
223
224
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
naji's avatar
naji committed
225
                        <executions>
unknown's avatar
unknown committed
226
                            <!-- download openjdk -->
naji's avatar
naji committed
227
                            <execution>
unknown's avatar
unknown committed
228
229
                                <id>download-jdk</id>
                                <phase>initialize</phase>
naji's avatar
naji committed
230
                                <goals>
unknown's avatar
unknown committed
231
                                    <goal>run</goal>
naji's avatar
naji committed
232
                                </goals>
unknown's avatar
unknown committed
233
234
235
236
237
238
239
240
                                <configuration>
                                    <target>
                                        <get src="https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip"
                                             dest="${project.build.directory}/jdk11.zip"
                                             verbose="false"
                                             usetimestamp="true"/>
                                    </target>
                                </configuration>
naji's avatar
naji committed
241
                            </execution>
unknown's avatar
unknown committed
242
243

                            <!-- unzip jdk -->
naji's avatar
naji committed
244
                            <execution>
unknown's avatar
unknown committed
245
246
247
248
249
250
251
252
                                <id>unzip-jdk</id>
                                <phase>package</phase>
                                <configuration>
                                    <tasks>
                                        <echo message="unzipping file" />
                                        <unzip src="${project.build.directory}/jdk11.zip" dest="${project.build.directory}/jdk11/" />
                                    </tasks>
                                </configuration>
naji's avatar
naji committed
253
                                <goals>
unknown's avatar
unknown committed
254
                                    <goal>run</goal>
naji's avatar
naji committed
255
256
257
258
259
260
261
262
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                    </plugin>
unknown's avatar
unknown committed
263
264

                    <!-- Generate pastis exe from jar -->
naji's avatar
naji committed
265
266
267
                    <plugin>
                        <groupId>com.akathist.maven.plugins.launch4j</groupId>
                        <artifactId>launch4j-maven-plugin</artifactId>
descamps's avatar
descamps committed
268
                        <version>${launch4j-maven-plugin.version}</version>
naji's avatar
naji committed
269
270
271
272
273
274
275
276
277
278
279
280
281
                        <executions>
                            <execution>
                                <id>build-pastis-standalone-executable-windows</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>launch4j</goal>
                                </goals>
                                <configuration>
                                    <headerType>console</headerType>
                                    <jar>${project.build.directory}/${project.build.finalName}.${project.packaging}
                                    </jar>
                                    <outfile>${project.build.directory}/${project.build.finalName}.exe</outfile>
                                    <jre>
unknown's avatar
unknown committed
282
                                        <path>./jdk11/jdk-11.0.2</path>
naji's avatar
naji committed
283
284
285
286
287
288
289
290
                                        <bundledJre64Bit>true</bundledJre64Bit>
                                        <runtimeBits>64</runtimeBits>
                                    </jre>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

unknown's avatar
unknown committed
291
                    <!-- Assembling all file required to start pastis exe with portable java included -->
naji's avatar
naji committed
292
293
294
295
296
297
298
299
300
301
302
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <descriptors>
descamps's avatar
descamps committed
303
                                        <descriptor>${project.basedir}/src/main/assembly/packaging-zip.xml</descriptor>
naji's avatar
naji committed
304
305
306
307
308
309
310
311
312
313
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

unknown's avatar
unknown committed
314

naji's avatar
naji committed
315
</project>