demo-cicd seed
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.otone.demo</groupId>
|
||||
<artifactId>demo-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<revision>1.0.0</revision>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.14.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>demo-api</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<configuration>
|
||||
<archive><manifest><mainClass>com.otone.demo.Api</mainClass></manifest></archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals><goal>shade</goal></goals>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.otone.demo.Api</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>nexus-releases</id>
|
||||
<url>https://nexus.otone.run/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.otone.demo;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class Api {
|
||||
public static void main(String[] args) throws Exception {
|
||||
HttpServer s = HttpServer.create(new java.net.InetSocketAddress(8080), 0);
|
||||
s.createContext("/", ex -> {
|
||||
String body = "hello from " + StringUtils.capitalize("demo-api");
|
||||
ex.sendResponseHeaders(200, body.getBytes().length);
|
||||
ex.getResponseBody().write(body.getBytes());
|
||||
ex.close();
|
||||
});
|
||||
s.start();
|
||||
System.out.println("demo-api listening :8080");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user