Skip to content

Commit

Permalink
Added archetype project
Browse files Browse the repository at this point in the history
- added example as archetype

Signed-off-by: Mark Hoffmann <m.hoffmann@data-in-motion.biz>
  • Loading branch information
maho7791 committed Jun 26, 2023
1 parent 17f77f7 commit 4b05e41
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 0 deletions.
40 changes: 40 additions & 0 deletions org.eclipse.osgitech.rest.archetype/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.eclipse.osgitech.rest</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>org.eclipse.osgitech.rest.archetype</artifactId>
<packaging>maven-archetype</packaging>
<name>JakartaREST / Jersey Whiteboard Example Archetype</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>3.1.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<archetype-descriptor
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0 https://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd"
name="org.eclipse.osgitech.rest.archetype" partial="false">
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>launch.bndrun</include>
<include>readme.md</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-runfw: org.apache.felix.framework

-runrequires: \
bnd.identity;id='${artifactId}',\
bnd.identity;id='org.eclipse.osgitech.rest.servlet.whiteboard',\
bnd.identity;id='org.eclipse.parsson.jakarta.json'

-runblacklist: \
bnd.identity;id='org.osgi.service.cm'

# Avoid To have the default Jetty run at port 8080
-runproperties: \
org.osgi.service.http.port=-1

-runbundles: \
jakarta.activation-api;version='[2.1.0,2.1.1)',\
jakarta.annotation-api;version='[2.1.1,2.1.2)',\
jakarta.inject.jakarta.inject-api;version='[2.0.1,2.0.2)',\
jakarta.validation.jakarta.validation-api;version='[3.0.2,3.0.3)',\
jakarta.ws.rs-api;version='[3.1.0,3.1.1)',\
jakarta.xml.bind-api;version='[4.0.0,4.0.1)',\
javassist;version='[3.29.0,3.29.1)',\
org.apache.aries.spifly.dynamic.framework.extension;version='[1.3.6,1.3.7)',\
org.apache.felix.cm.json;version='[2.0.0,2.0.1)',\
org.apache.felix.configadmin;version='[1.9.24,1.9.25)',\
org.apache.felix.configurator;version='[1.0.18,1.0.19)',\
org.apache.felix.http.jetty;version='[5.0.4,5.0.5)',\
org.apache.felix.http.servlet-api;version='[2.1.0,2.1.1)',\
org.apache.felix.scr;version='[2.2.6,2.2.7)',\
org.eclipse.osgitech.rest;version='[1.0.0,1.0.1)',\
org.eclipse.osgitech.rest.servlet.whiteboard;version='[1.0.0,1.0.1)',\
org.eclipse.osgitech.rest.sse;version='[1.0.0,1.0.1)',\
org.eclipse.parsson.jakarta.json;version='[1.1.2,1.1.3)',\
org.glassfish.hk2.api;version='[3.0.4,3.0.5)',\
org.glassfish.hk2.external.aopalliance-repackaged;version='[3.0.4,3.0.5)',\
org.glassfish.hk2.locator;version='[3.0.4,3.0.5)',\
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
org.glassfish.hk2.utils;version='[3.0.4,3.0.5)',\
org.glassfish.jersey.containers.jersey-container-servlet;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.containers.jersey-container-servlet-core;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.core.jersey-client;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.core.jersey-common;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.core.jersey-server;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.inject.jersey-hk2;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.media.jersey-media-jaxb;version='[3.1.2,3.1.3)',\
org.glassfish.jersey.media.jersey-media-sse;version='[3.1.2,3.1.3)',\
org.objectweb.asm;version='[9.5.0,9.5.1)',\
org.osgi.service.component;version='[1.5.1,1.5.2)',\
org.osgi.service.jakartars;version='[2.0.0,2.0.1)',\
org.osgi.util.converter;version='[1.0.9,1.0.10)',\
org.osgi.util.function;version='[1.2.0,1.2.1)',\
org.osgi.util.promise;version='[1.3.0,1.3.1)',\
slf4j.api;version='[1.7.36,1.7.37)',\
slf4j.simple;version='[1.7.36,1.7.37)',\
${artifactId};version=snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<name>JakartaREST / Jersey Whiteboard Example Application in ${artifactId}</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<bnd.version>6.4.0</bnd.version>
<jersey.version>3.1.2</jersey.version>
</properties>

<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.jakartars</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.servlet</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgitech.rest</groupId>
<artifactId>org.eclipse.osgitech.rest.servlet.whiteboard</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgitech.rest</groupId>
<artifactId>org.eclipse.osgitech.rest.sse</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component</artifactId>
<version>1.5.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<version>1.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
<version>${jersey.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-sse</artifactId>
<version>${jersey.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
<version>4.0.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>osgi-resource-locator</artifactId>
<version>1.0.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.util.converter</artifactId>
<version>1.0.9</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.util.function</artifactId>
<version>1.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.util.promise</artifactId>
<version>1.3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>jakarta.json</artifactId>
<version>1.1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
<version>2.2.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>7.0.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>5.0.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.servlet-api</artifactId>
<version>2.1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.cm.json</artifactId>
<version>2.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configurator</artifactId>
<version>1.0.18</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
<version>1.9.24</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.aries.spifly</groupId>
<artifactId>org.apache.aries.spifly.dynamic.framework.extension</artifactId>
<version>1.3.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>${bnd.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<bnd><![CDATA[
-noextraheaders: true
-noimportjava: true
-fixupmessages: The JAR is empty:
Require-Capability: osgi.extender;filter:='(osgi.extender=osgi.configurator)'
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-resolver-maven-plugin</artifactId>
<version>${bnd.version}</version>
<configuration>
<failOnChanges>false</failOnChanges>
<bndruns>
<include>launch.bndrun</include>
</bndruns>
</configuration>
<executions>
<execution>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-run-maven-plugin</artifactId>
<version>${bnd.version}</version>
<configuration>
<failOnChanges>false</failOnChanges>
<bndrun>launch.bndrun</bndrun>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Example Project

## Build project

You need to build the whole *org.eclipse.osgitech.rest* project first from the parent.

* Call `mvn clean install` to build the example.
* Check, if there are changes in the launch configuration. This can be executed when e.g. the run command fails: `mvn bnd-resolver:resolve`
* To test the project call: `mvn bnd-run:run`
* Find the application under: [http://localhost:8081/demo/rest/hello-http-whiteboard](http://localhost:8081/demo/rest/hello-http-whiteboard)

Loading

0 comments on commit 4b05e41

Please sign in to comment.