Asynchronous Spring Initializr API wrapper for Kotlin/JVM

Overview

initializr-kt

Asynchronous Spring Initializr API wrapper for Kotlin/JVM.
This library provides the simplest DSL for initializing Spring Boot projects using Spring Initializr.

Installation

repositories {
    maven(url = "https://jitpack.io")
}

dependencies {
    implementation("dev.d1s:initializr-kt:$initializrKtVersion")
}

Example usage

suspend fun main() {
    val zip = newProject {
        packageName = "dev.d1s.test"
        group = "dev.d1s"
        artifact = "test"
        name = "test"
        language = ProjectLanguage.KOTLIN
        type = ProjectType.GRADLE
        javaVersion = JavaVersion.VERSION_11
        packaging = ProjectPackaging.JAR
        springBootVersion = "3.0.0-M1" // latest
        dependencies += setOf(
            ProjectDependency.SPRING_REACTIVE_WEB,
            ProjectDependency.SPRING_DATA_JPA
        )
    }

    withContext(Dispatchers.IO) {
        Files.write(Paths.get("./test.zip"), zip, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
    }
}

Note that the initialization will fail if any of the properties is not satisfied. To avoid this, you can describe the default project configuration.

Default project configuration

Configure the default project configuration:

suspend fun main() {
    
    // async
    defaultProjectConfiguration {
        language = ProjectLanguage.KOTLIN
        type = ProjectType.GRADLE
        javaVersion = JavaVersion.VERSION_11
        packaging = ProjectPackaging.JAR
        springBootVersion = "3.0.0-M1" // latest
    }
    
    // you will not be required to satisfy preconfigured properties:
    val zip = newProject {
        packageName = "dev.d1s.anotherTest"
        group = "dev.d1s"
        artifact = "another-test"
        name = "another-test"
        dependencies += setOf(
            ProjectDependency.SPRING_REACTIVE_WEB,
            ProjectDependency.SPRING_DATA_JPA
        )
    }
}
You might also like...
Ktor is an asynchronous framework for creating microservices, web applications and more.
Ktor is an asynchronous framework for creating microservices, web applications and more.

ktor-sample Ktor is an asynchronous framework for creating microservices, web applications and more. Written in Kotlin from the ground up. Application

This lib is the framework for dependency tasks, specially for the asynchronous tasks.

DependencyTask This lib is the framework for dependency tasks, specially for the asynchronous tasks. Backgroud Image that there is a progress with som

Execute asynchronous batch tasks with predefined or custom UI in Android.
Execute asynchronous batch tasks with predefined or custom UI in Android.

AndroidBatchWorker Execute asynchronous batch tasks with predefined or custom UI in Android. Import Add JitPack repository to your project level build

Katoot - An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api

katoot An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api. Usage Qui

API for a library using Kotlin, Spring-boot and covered by test

Library API This API is to create Books and be able to borrow from them I'm using: Spring Boot version 2.5.6 Kotlin 1.5.31 Java 11 I'm implementing us

API Rest With Kotlin And Spring Boot

##API REST WITH KOTLIN AND SPRING BOOT GET Url: http://localhost:8080/customers Response (Status Code: 200 Ok) { "_embedded": { "customer

API que converte uma planilha do excel para o banco de dados, utilizando Kotlin + Spring.

API Excel2DB 📈 Uma API que tem como objetivo facilitar a carga de dados nos formatos .xlsx ou .xls para um banco de dados. Nessa situação, como o foc

Cargo service: REST API, Spring Boot, Kotlin, JDBC, PostgreSQL

cargo-jdbc Cargo service, training project with Spring Boot, JDBC and Kotlin. To

Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Simple Todo list API using Spring-Boot, Webflux, Kotlin, Coroutines, & PostgreSQL

Releases(1.0.0-stable.3)
Owner
Mikhail Titov
Java/Kotlin software engineer and enthusiast. Mostly interested in backend. Get the fastest response on my telegram: @d1snin.
Mikhail Titov
Spring-graphql-getting-started - Spring for GraphQL provides support for Spring applications built on GraphQL Java

Getting Started with GraphQL and Spring Boot Spring for GraphQL provides support

Shinya 0 Feb 2, 2022
Spring-kotlin - Learning API Rest with Kotlin, Spring and PostgreSQL

Kotlin, Spring, PostgreSQL and Liquibase Database Migrations Learning Kotlin for

Andre L S Ferreira 2 Feb 14, 2022
An implementation of MediatR on JVM for Spring using Kotlin coroutines

Kpring MediatR In this project, an attempt has been made to implement the mediator pattern on the JVM with simplicity using Kotlin with native corouti

Mahdi Bohloul 4 Aug 6, 2022
Reactive setup with Spring WebFlux , Kotlin, Postgres and Spring Data R2DBC

Reactive Spring with Kotlin and Pg Spring WebFlux with Netty instead of Spring Web with Tomcat Mono and Flux in all layers (controller, service, repo)

Bimal Raj Gyawali 7 Dec 9, 2022
This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

Maksim Kostromin 2 Nov 29, 2021
Spring-with-maven - Spring Boot App with Postgresql and maven

Spring Boot Api Aplikasi ini dibuat menggunakan bahasa kotlin dan untuk database

Aldi Aulia Rosyad 1 Jan 12, 2022
Android login spring - Android login against spring backend

Android Jetpack Compose login implementation with JWT tokens against our own bac

null 1 Feb 13, 2022
High performance and fully asynchronous pulsar client with Kotlin and Vert.x

pulsarkt High performance pulsar client with Kotlin and Vert.x Features Basic Producer/Consumer API Partitioned topics Batching Chunking Compression T

null 1 Nov 5, 2021
Webclient-kotlin-sample - An example of using the http web client to promote synchronous and asynchronous https calls

Web Client Consumer Kotlin Sample The project is an example of using the http we

null 1 May 1, 2022
MMKV for Kotlin Multiplatform is a wrapper for MMKV using Kotlin API

MMKV for Kotlin Multiplatform is a wrapper for MMKV using Kotlin API

Ctrip, Inc. 65 Dec 29, 2022