Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</developers>
<modules>
<module>spring-boot3</module>
<module>spring-boot4</module>
</modules>
<scm>
<connection>scm:git:git://github.com/SAP/cloud-sdk-java.git</connection>
Expand Down
Empty file.
35 changes: 35 additions & 0 deletions archetypes/spring-boot4/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>com.sap.cloud.sdk.archetypes</groupId>
<artifactId>archetypes-parent</artifactId>
<version>5.34.0-SNAPSHOT</version>
</parent>
<artifactId>spring-boot4</artifactId>
<packaging>maven-archetype</packaging>
<name>Archetypes - SAP CP Cloud Foundry + Spring Boot 4</name>
<description>Archetype for a Spring-based project on SAP Business Technology Platform (Cloud Foundry).</description>
<url>https://sap.github.io/cloud-sdk/docs/java/getting-started</url>
<organization>
<name>SAP SE</name>
<url>https://www.sap.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>SAP</name>
<email>cloudsdk@sap.com</email>
<organization>SAP SE</organization>
<organizationUrl>https://www.sap.com</organizationUrl>
</developer>
</developers>
<properties>
<project.rootdir>${project.basedir}/../../</project.rootdir>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="Archetypes - SAP CP Cloud Foundry + Spring"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<requiredProperties>
<requiredProperty key="artifactId">
<validationRegex>[^_]+</validationRegex>
</requiredProperty>
<requiredProperty key="gitignore">
<defaultValue>.gitignore</defaultValue>
</requiredProperty>
</requiredProperties>

<fileSets>
<!-- root folder -->
<fileSet filtered="true">
<directory/>
<includes>
<include>manifest.yml</include>
</includes>
</fileSet>

<fileSet filtered="false">
<directory/>
<includes>
<include>__gitignore__</include>
<include>Jenkinsfile</include>
<include>.pipeline/config.yml</include>
</includes>
</fileSet>

<!-- application folder -->
<fileSet filtered="true">
<directory>application</directory>
<includes>
<include>pom.xml</include>
</includes>
</fileSet>

<fileSet filtered="true">
<directory>application/src</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory>application/src/main/resources</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory>application/src/test/resources</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/credentials.*
**/target/
/s4hana_pipeline
**/*.log
**/*.trc
**/.settings/
**/.project
**/.classpath
**/.idea
**/*.iml
**/.vscode
**/node_modules
**/.DS_Store
.pipeline/commonPipelineEnvironment
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
<?xml version='1.0' encoding='utf-8'?>
<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>

<name>${artifactId} - Application</name>
<description>${artifactId} - Application</description>

<artifactId>${artifactId}-application</artifactId>
<version>${version}</version>

<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</parent>

<properties>
<surefire.skipTests>false</surefire.skipTests>
<surefire.forkCount>1</surefire.forkCount>
<surefire.include>*</surefire.include>
<surefire.exclude />
<surefire.groups />
<surefire.excludedGroups />
<surefire.maxMemorySize>1024m</surefire.maxMemorySize>
<surefire.logLevel>info</surefire.logLevel>

<!--
Use the argLine property to define the arguments for the JVMs that are forked by the surefire plugin.
This avoids the need to use late property evaluation for configuring the jacoco plugin.
Relying on late evaluation of properties such as @{argLine} can result in issues with certain IDEs.

For more details, visit:
https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
-->
<argLine>-Xmx${surefire.maxMemorySize} -Dorg.slf4j.simpleLogger.defaultLogLevel=${surefire.logLevel}</argLine>

<jacoco.executionDataFile>${project.build.directory}/coverage-reports/jacoco.exec</jacoco.executionDataFile>
<jacoco.includes>*</jacoco.includes>
<jacoco.excludes>org.apache.*</jacoco.excludes>
</properties>

<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-logback</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-web-server</artifactId>
</dependency>

<!-- Dependencies for generated OData V4 VDM -->
<!--
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-v4-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
-->

<!-- Dependencies for security setup -->
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.security</groupId>
<artifactId>resourceserver-security-spring-boot-starter</artifactId>
</dependency>
-->

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>
<!-- Provides MockMvc test auto-configuration (e.g. @AutoConfigureMockMvc), split into its own module in Spring Boot 4. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-webmvc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Dependencies for security setup -->
<!--
<dependency>
<groupId>com.sap.cloud.security</groupId>
<artifactId>java-security-test</artifactId>
<scope>test</scope>
</dependency>
-->

<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.1</version>
<scope>test</scope>
<exclusions>
<!-- exclude android-json to avoid conflict with org.json:json -->
<!-- see also: https://github.com/spring-projects/spring-boot/issues/8706 -->
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<attach>false</attach>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.13</version>
<configuration>
<destFile>${jacoco.executionDataFile}</destFile>
<dataFile>${jacoco.executionDataFile}</dataFile>
<includes>${jacoco.includes}</includes>
<excludes>${jacoco.excludes}</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skipTests>${surefire.skipTests}</skipTests>
<includes>
<include>${surefire.include}</include>
</includes>
<excludes>
<exclude>${surefire.exclude}</exclude>
</excludes>
<forkCount>${surefire.forkCount}</forkCount>
<reuseForks>false</reuseForks>
<groups>${surefire.groups}</groups>
<excludedGroups>${surefire.excludedGroups}</excludedGroups>
<systemPropertyVariables>
<surefire.forkDir>${project.build.directory}/surefire-fork/${surefire.forkNumber}/
</surefire.forkDir>
</systemPropertyVariables>
</configuration>
</plugin>

<!-- Plugin for generating Java classes from OData V4 metadata -->
<!-- Have a look into our documentation for more details as well as the OData V2 generator: -->
<!-- https://sap.github.io/cloud-sdk/docs/java/features/odata/vdm-generator -->
<!--
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-v4-generator-maven-plugin</artifactId>
<version>${cloud-sdk.version}</version>
<executions>
<execution>
<id>generate-consumption</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/src/main/resources/edmx</inputDirectory>
<outputDirectory>${project.build.directory}/vdm</outputDirectory>
<deleteOutputDirectory>true</deleteOutputDirectory>
<packageName>${package}</packageName>
<defaultBasePath>odata/v4/</defaultBasePath>
<compileScope>COMPILE</compileScope>
<serviceMethodsPerEntitySet>true</serviceMethodsPerEntitySet>
</configuration>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package};

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.server.servlet.context.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan({"com.sap.cloud.sdk", "${package}"})
@ServletComponentScan({"com.sap.cloud.sdk", "${package}"})
public class Application extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure( final SpringApplicationBuilder application )
{
return application.sources(Application.class);
}

public static void main( final String[] args )
{
SpringApplication.run(Application.class, args);
}
}
Loading