-
Notifications
You must be signed in to change notification settings - Fork 32
feat: create new archetype #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
n-o-u-r-h-a-n
wants to merge
7
commits into
main
Choose a base branch
from
spring7-archetype
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ce14c93
create new archetype
n-o-u-r-h-a-n d101795
Merge branch 'main' into spring7-archetype
n-o-u-r-h-a-n f6b2d62
fix archetype
n-o-u-r-h-a-n 677a687
Merge branch 'main' into spring7-archetype
n-o-u-r-h-a-n be7affc
fix archetype
n-o-u-r-h-a-n fd37038
Merge remote-tracking branch 'origin/spring7-archetype' into spring7-…
n-o-u-r-h-a-n 9be69e2
snapshot version fix
n-o-u-r-h-a-n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.33.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> |
62 changes: 62 additions & 0 deletions
62
archetypes/spring-boot4/src/main/resources/META-INF/maven/archetype-metadata.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
14 changes: 14 additions & 0 deletions
14
archetypes/spring-boot4/src/main/resources/archetype-resources/__gitignore__
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
234 changes: 234 additions & 0 deletions
234
archetypes/spring-boot4/src/main/resources/archetype-resources/application/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,234 @@ | ||
| <?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> | ||
|
|
||
| <!-- 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> | ||
| <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.10</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> |
28 changes: 28 additions & 0 deletions
28
...es/archetype-resources/application/src/main/java/__packageInPathFormat__/Application.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.servlet.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); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.