-
Notifications
You must be signed in to change notification settings - Fork 339
/
pom.xml
189 lines (173 loc) · 8.6 KB
/
pom.xml
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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Distribution License v. 1.0, which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: BSD-3-Clause
-->
<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>
<parent>
<groupId>org.glassfish.jersey.examples</groupId>
<artifactId>osgi-helloworld-webapp</artifactId>
<version>2.43</version>
</parent>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
<artifactId>war-bundle</artifactId>
<name>jersey-examples-osgi-helloworld-webapp-wab</name>
<packaging>war</packaging>
<description>OSGi Helloworld Webapp WAR bundle</description>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
<artifactId>lib-bundle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
<artifactId>additional-bundle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.examples.osgi-helloworld-webapp</groupId>
<artifactId>alternate-version-bundle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet2.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.eventadmin</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- to generate the MANIFEST-FILE required by the bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>${project.build.directory}/META-INF</manifestLocation>
<supportedProjectTypes>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
<Import-Package>
org.glassfish.jersey.servlet,
<!--
This package is exported by two different bundle versions of 'additional-bundle'
- one is in the maven module 'additional-bundle' with the current ${project.version},
- the other one is in the maven module 'alternate-version-bundle' with Bundle-Version 2.2.1
(the names of maven artifacts have to be unique, but the name of bundles
(defined in the maven-bundle-plugin configuration) is the same for both.
Both bundles (additional-bundle 2.2.1 and additional-bundle ${project.version} are loaded into
OSGi runtime, so that there are two versions of the same resource available, each one returning
different string as a response. If the import version is changed to [2.2,2.3) as prepared below,
the test will fail (the response returned from the alternate version of the bundle is different).
NOTE - to test this, the version has to be restricted from above, otherwise OSGi can choose any of
the two bundles, as version="2.2" actually means "version 2.2. or higher".
-->
<!-- TODO: newer bundle plugin (3.2.0) generates version string from SNAPSHOTS differently than 2.x version -->
org.glassfish.jersey.examples.osgi.helloworld.additional.resource,
<!-- org.glassfish.jersey.examples.osgi.helloworld.additional.resource;version="${project.version}",-->
<!-- org.glassfish.jersey.examples.osgi.helloworld.additional.resource;version="[2.2,2.3)", -->
*
</Import-Package>
<Export-Package>
org.glassfish.jersey.examples.osgi.helloworld,
org.glassfish.jersey.examples.osgi.helloworld.resource,
org.glassfish.jersey.examples.osgi.helloworld.additional.resource
</Export-Package>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Webapp-Context>helloworld</Webapp-Context>
<Web-ContextPath>helloworld</Web-ContextPath>
<Bundle-Activator>org.glassfish.jersey.examples.osgi.helloworld.WebAppContextListener</Bundle-Activator>
<_wab>src/main/webapp</_wab>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<attachClasses>true</attachClasses>
<archive>
<manifestFile>${project.build.directory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Bundle-ClassPath>WEB-INF/classes</Bundle-ClassPath>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<!-- do not create source zip bundles -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>moxy</id>
<activation>
<property>
<name>moxy</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>${moxy.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>