Skip to content

Commit 0109a27

Browse files
committed
build(archetype): bnd migration
1 parent 2d05dc0 commit 0109a27

13 files changed

Lines changed: 419 additions & 491 deletions

File tree

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/__package__/META-INF/MANIFEST.MF

Lines changed: 0 additions & 15 deletions
This file was deleted.

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/__package__/build.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/__package__/pom.xml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</parent>
2626

2727
<artifactId>${package}</artifactId>
28-
<packaging>eclipse-plugin</packaging>
28+
<packaging>jar</packaging>
2929
<description>${package} plugin</description>
3030

3131
<properties>
@@ -34,8 +34,47 @@
3434
</sonar.coverage.jacoco.xmlReportPaths>
3535
</properties>
3636

37+
<dependencies>
38+
<dependency>
39+
<groupId>org.slf4j</groupId>
40+
<artifactId>slf4j-api</artifactId>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.eclipse.kura</groupId>
44+
<artifactId>org.eclipse.kura.api</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.eclipse.kura</groupId>
48+
<artifactId>org.eclipse.kura.core</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.osgi</groupId>
52+
<artifactId>org.osgi.framework</artifactId>
53+
<version>1.10.0</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.osgi</groupId>
57+
<artifactId>org.osgi.service.component.annotations</artifactId>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.osgi</groupId>
61+
<artifactId>org.osgi.service.metatype.annotations</artifactId>
62+
</dependency>
63+
</dependencies>
64+
3765
<build>
3866
<plugins>
67+
<plugin>
68+
<groupId>biz.aQute.bnd</groupId>
69+
<artifactId>bnd-maven-plugin</artifactId>
70+
<configuration>
71+
<includeClassesDir>true</includeClassesDir>
72+
<bnd><![CDATA[
73+
Bundle-SymbolicName: ${project.artifactId};singleton:=true
74+
Bundle-ActivationPolicy: lazy
75+
]]></bnd>
76+
</configuration>
77+
</plugin>
3978
<plugin>
4079
<groupId>org.apache.maven.plugins</groupId>
4180
<artifactId>maven-deploy-plugin</artifactId>
@@ -47,4 +86,4 @@
4786
</build>
4887

4988

50-
</project>
89+
</project>

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/distrib/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
<dependency>
3535
<groupId>${groupId}</groupId>
3636
<artifactId>${package}</artifactId>
37-
<type>eclipse-plugin</type>
37+
<type>jar</type>
38+
<version>${project.version}</version>
3839
</dependency>
3940
</dependencies>
4041

kura/tools/kura-addon-archetype/src/main/resources/archetype-resources/pom.xml

Lines changed: 86 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@
5050
<properties>
5151
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5252
<maven.compiler.release>21</maven.compiler.release>
53-
<tycho.version>5.0.2</tycho.version>
5453
<bnd.version>7.1.0</bnd.version>
5554
</properties>
5655

5756
<modules>
5857
<module>bom</module>
59-
<module>target-definition</module>
6058
<module>${package}</module>
6159
<module>distrib</module>
6260
<module>tests</module>
@@ -106,6 +104,11 @@
106104
<name>Kura Addons Maven Repository</name>
107105
<url>https://artifactory.dev.everyware.io/artifactory/kura-addons</url>
108106
</repository>
107+
<repository>
108+
<!-- moquette-broker -->
109+
<id>jitpack.io</id>
110+
<url>https://jitpack.io</url>
111+
</repository>
109112
</repositories>
110113

111114
<pluginRepositories>
@@ -138,80 +141,120 @@
138141
<pluginManagement>
139142
<plugins>
140143
<plugin>
141-
<groupId>org.eclipse.tycho</groupId>
142-
<artifactId>tycho-compiler-plugin</artifactId>
143-
<version>${tycho.version}</version>
144+
<groupId>biz.aQute.bnd</groupId>
145+
<artifactId>bnd-maven-plugin</artifactId>
146+
<version>${bnd.version}</version>
147+
<executions>
148+
<execution>
149+
<goals>
150+
<goal>bnd-process</goal>
151+
</goals>
152+
</execution>
153+
</executions>
154+
</plugin>
155+
156+
<!-- Required to make the maven-jar-plugin pick up the bnd
157+
generated manifest. Also avoid packaging empty Jars -->
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-jar-plugin</artifactId>
161+
<version>3.0.2</version>
144162
<configuration>
145-
<source>${maven.compiler.release}</source>
146-
<target>${maven.compiler.release}</target>
147-
<showDeprecation>true</showDeprecation>
148-
<showWarnings>true</showWarnings>
163+
<archive>
164+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
165+
</archive>
166+
<skipIfEmpty>true</skipIfEmpty>
149167
</configuration>
150168
</plugin>
151169

170+
<!-- Define the version of the export plugin we should use -->
152171
<plugin>
153-
<groupId>org.eclipse.tycho</groupId>
154-
<artifactId>tycho-maven-plugin</artifactId>
155-
<version>${tycho.version}</version>
156-
<extensions>true</extensions>
172+
<groupId>biz.aQute.bnd</groupId>
173+
<artifactId>bnd-export-maven-plugin</artifactId>
174+
<version>${bnd.version}</version>
175+
<executions>
176+
<execution>
177+
<goals>
178+
<goal>export</goal>
179+
</goals>
180+
</execution>
181+
</executions>
157182
</plugin>
158183

184+
<!-- Setup the indexer for running and testing -->
159185
<plugin>
160-
<groupId>org.eclipse.tycho</groupId>
161-
<artifactId>target-platform-configuration</artifactId>
162-
<version>${tycho.version}</version>
186+
<groupId>biz.aQute.bnd</groupId>
187+
<artifactId>bnd-indexer-maven-plugin</artifactId>
188+
<version>${bnd.version}</version>
163189
<configuration>
164-
<target>
165-
<artifact>
166-
<groupId>${groupId}</groupId>
167-
<artifactId>${artifactId}-target-definition</artifactId>
168-
<version>${project.version}</version>
169-
</artifact>
170-
</target>
190+
<localURLs>REQUIRED</localURLs>
191+
<attach>false</attach>
171192
</configuration>
193+
<executions>
194+
<execution>
195+
<id>index</id>
196+
<goals>
197+
<goal>index</goal>
198+
</goals>
199+
<configuration>
200+
<indexName>${project.artifactId}</indexName>
201+
</configuration>
202+
</execution>
203+
<execution>
204+
<id>test-index</id>
205+
<goals>
206+
<goal>index</goal>
207+
</goals>
208+
<configuration>
209+
<indexName>${project.artifactId}</indexName>
210+
<outputFile>${project.build.directory}/test-index.xml</outputFile>
211+
<scopes>
212+
<scope>test</scope>
213+
</scopes>
214+
</configuration>
215+
</execution>
216+
</executions>
172217
</plugin>
173218

219+
<!-- Define the version of the resolver plugin we use -->
174220
<plugin>
175-
<groupId>org.eclipse.tycho</groupId>
176-
<artifactId>tycho-packaging-plugin</artifactId>
177-
<version>${tycho.version}</version>
221+
<groupId>biz.aQute.bnd</groupId>
222+
<artifactId>bnd-resolver-maven-plugin</artifactId>
223+
<version>${bnd.version}</version>
178224
<configuration>
179-
<skipPomGeneration>true</skipPomGeneration>
225+
<failOnChanges>false</failOnChanges>
226+
<bndruns>
227+
</bndruns>
180228
</configuration>
181-
</plugin>
182-
183-
<plugin>
184-
<groupId>org.eclipse.tycho</groupId>
185-
<artifactId>tycho-source-plugin</artifactId>
186-
<version>${tycho.version}</version>
187229
<executions>
188230
<execution>
189-
<id>plugin-source</id>
190231
<goals>
191-
<goal>plugin-source</goal>
232+
<goal>resolve</goal>
192233
</goals>
193234
</execution>
194235
</executions>
195236
</plugin>
196237

197-
<!-- Used for generating SCR descriptors in the Maven Build, supports M2E
198-
Incremental builds as well -->
238+
<!-- Define the version of the testing plugin that we use -->
199239
<plugin>
200240
<groupId>biz.aQute.bnd</groupId>
201-
<artifactId>bnd-maven-plugin</artifactId>
241+
<artifactId>bnd-testing-maven-plugin</artifactId>
202242
<version>${bnd.version}</version>
243+
<configuration>
244+
<reportsDir>${project.build.directory}/surefire-reports</reportsDir>
245+
</configuration>
203246
<executions>
204247
<execution>
205248
<goals>
206-
<goal>bnd-process</goal>
249+
<goal>testing</goal>
207250
</goals>
208-
<configuration>
209-
<packagingTypes>eclipse-plugin,eclipse-test-plugin</packagingTypes>
210-
</configuration>
211251
</execution>
212252
</executions>
213253
</plugin>
214254

255+
<!-- Define the version of the baseline plugin we use and
256+
avoid failing when no baseline jar exists. (for example before the first
257+
release) -->
215258
<plugin>
216259
<groupId>biz.aQute.bnd</groupId>
217260
<artifactId>bnd-baseline-maven-plugin</artifactId>
@@ -221,7 +264,6 @@
221264
</configuration>
222265
<executions>
223266
<execution>
224-
<id>baseline</id>
225267
<goals>
226268
<goal>baseline</goal>
227269
</goals>
@@ -247,44 +289,6 @@
247289
</executions>
248290
</plugin>
249291

250-
<!-- This plugin's configuration is used to store Eclipse m2e settings only. It has
251-
no influence on the Maven build itself. -->
252-
<plugin>
253-
<groupId>org.eclipse.m2e</groupId>
254-
<artifactId>lifecycle-mapping</artifactId>
255-
<version>1.0.0</version>
256-
<configuration>
257-
<lifecycleMappingFilters>
258-
<lifecycleMappingFilter>
259-
<symbolicName>org.eclipse.m2e.pde.connector</symbolicName>
260-
<versionRange>[2.1.2,)</versionRange>
261-
<packagingTypes>
262-
<packagingType>eclipse-test-plugin</packagingType>
263-
<packagingType>eclipse-plugin</packagingType>
264-
<packagingType>eclipse-feature</packagingType>
265-
</packagingTypes>
266-
</lifecycleMappingFilter>
267-
</lifecycleMappingFilters>
268-
<lifecycleMappingMetadata>
269-
<pluginExecutions>
270-
<pluginExecution>
271-
<pluginExecutionFilter>
272-
<groupId>biz.aQute.bnd</groupId>
273-
<artifactId>bnd-maven-plugin</artifactId>
274-
<versionRange>[0.0.0,)</versionRange>
275-
<goals>
276-
<goal>bnd-process</goal>
277-
</goals>
278-
</pluginExecutionFilter>
279-
<action>
280-
<ignore />
281-
</action>
282-
</pluginExecution>
283-
</pluginExecutions>
284-
</lifecycleMappingMetadata>
285-
</configuration>
286-
</plugin>
287-
288292
<plugin>
289293
<groupId>org.codehaus.mojo</groupId>
290294
<artifactId>flatten-maven-plugin</artifactId>
@@ -361,26 +365,6 @@
361365
</pluginManagement>
362366

363367
<plugins>
364-
<plugin>
365-
<groupId>org.eclipse.tycho</groupId>
366-
<artifactId>tycho-maven-plugin</artifactId>
367-
</plugin>
368-
<plugin>
369-
<groupId>org.eclipse.tycho</groupId>
370-
<artifactId>tycho-compiler-plugin</artifactId>
371-
</plugin>
372-
<plugin>
373-
<groupId>org.eclipse.tycho</groupId>
374-
<artifactId>target-platform-configuration</artifactId>
375-
</plugin>
376-
<plugin>
377-
<groupId>org.eclipse.tycho</groupId>
378-
<artifactId>tycho-packaging-plugin</artifactId>
379-
</plugin>
380-
<plugin>
381-
<groupId>org.eclipse.tycho</groupId>
382-
<artifactId>tycho-source-plugin</artifactId>
383-
</plugin>
384368
<plugin>
385369
<groupId>biz.aQute.bnd</groupId>
386370
<artifactId>bnd-maven-plugin</artifactId>
@@ -405,4 +389,4 @@
405389
</plugins>
406390
</build>
407391

408-
</project>
392+
</project>

0 commit comments

Comments
 (0)