Skip to content

taxy4fun/boot-cantaloupe

Repository files navigation

boot-cantaloupe project

boot cantaloupemaster

Codacy code quality

Note
testing and tasting the Boot fruit. Java-8, forgive us!!!

1. Front Layer (our dear brother)

2. Conventions, Rules, Duties

3. JDK & friends download and installation

  1. Java SE Development Kit 8

    wget --no-check-certificate --no-cookies \
      --header "Cookie: oraclelicense=accept-securebackup-cookie" \
      --progress=dot:giga \
      http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
    sudo tar xvf jdk-8u144-linux-x64.tar.gz -C /usr/local/share/
    sudo ln -sf /usr/local/share/jdk1.8.0_144/bin/java /usr/local/bin/java
    java -version
  2. Java SE Development Kit 9

    wget --no-check-certificate --no-cookies \
     --header "Cookie: oraclelicense=accept-securebackup-cookie" \
     --progress=dot:giga \
     http://download.oracle.com/otn-pub/java/jdk/9+181/jdk-9_linux-x64_bin.tar.gz
    sudo tar xvf jdk-9_linux-x64_bin.tar.gz -C /usr/local/share/
    sudo ln -sf /usr/local/share/jdk-9/bin/java /usr/local/bin/java
    java -version
  3. Gradle 4.x [check last version]

    wget --progress=dot:giga \
      https://services.gradle.org/distributions/gradle-4.2-all.zip
    sudo unzip gradle-4.2-all.zip -d /usr/local/share/
    sudo ln -sf /usr/local/share/gradle-4.2/bin/gradle /usr/local/bin/gradle
    gradle -version
    gradle wrapper --gradle-version 4.2
  4. Maven 3.5.x [check last version]

    wget --progress=dot:giga \
      http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz
    sudo tar xvf apache-maven-3.5.0-bin.tar.gz -C /usr/local/share/
    sudo ln -sf /usr/local/share/apache-maven-3.5.0/bin/mvn /usr/local/bin/mvn
    mvn -v
  5. Ascii Art Generator

    http://patorjk.com/software/taag/

4. Basic Dummy Project

  1. Crear una carpeta con el nombre del proyecto y acceder.

  2. Crear el fichero build.gradle con las configuraciones necesarias

  3. Crear los directorios del proyecto.

  4. Crear la clase principal App.java.

Terminal.app
$ mkdir myproject && cd myproject (1)

$ touch build.gradle (2)

$ mkdir -p src/{main,test}/{java,resources} src/main/java/com/myproject (3)

$ touch src/main/java/com/myproject/App.java (4)
build.gradle
plugins {
    id 'org.springframework.boot' version '1.5.10.RELEASE'
    id 'java'
}

jar {
    baseName = 'myproject'
    version =  '1.0.0-SNAPSHOT'
}

repositories {
    jcenter()
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter")
    testCompile("org.springframework.boot:spring-boot-starter-test")
}
App.java
package com.springuers.taxy4fun;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class HelloWorldApp implements CommandLineRunner {

    private static final Logger LOGGER = LoggerFactory.getLogger(HelloWorldApp.class);

    @Override
    public void run(String... args) throws Exception {
        LOGGER.info("Hello from Boot Cantaloupe basic application!");
    }

    public static void main (String[] args) {
        SpringApplication.run(HelloWorldApp.class, args);
    }
}
  1. Lista las tareas disponibles para gradle.

  2. Ejecuta la aplicación boot.

Terminal.app
$ ./gradlew tasks (1)

$ gradlew hello-world:boRu (2)

YYYY-MM-DD HH:mm:ss  INFO 1049 --- [main] com.springuers.taxy4fun.HelloWorldApp : Hello from Boot Cantaloupe basic application!
YYYY-MM-DD HH:mm:ss  INFO 1049 --- [main] com.springuers.taxy4fun.HelloWorldApp : Started HelloWorldApp in 10.813 seconds (JVM running for 11.138)

5. Useful commands

5.1. gradle

Mostrar las dependencias de un subproyecto.

./gradlew repository:dependencies --configuration compile

Escribir las trazas de ejecución con nivel debug a un archivo para su posterior análisis.

./gradlew test --debug > /tmp/gradle.log

Lanzar un test o grupo de tests determinado en un subproyecto.

./gradlew repository:test -Dtest.single=PersonRepositoryTest
./gradlew clean -Dtest.single=*DtoTest test

Generar informe de dependencias del proyecto

./gradlew htmlDependencyReport

About

testing and tasting the Boot fruit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages