Skip to content

maven wrapper and application properties

Shelson Ferrari edited this page Jul 23, 2024 · 5 revisions

Maven Wrapper and application.properties

Maven Wrapper (mvnw and mvnw.cmd)

The Maven Wrapper is a tool that allows a project to use a specific version of Maven without needing to install Maven manually on the development machine. This ensures that all developers use the same version of Maven, avoiding compatibility issues.

Maven Wrapper Files

  • mvnw: Script for Unix/Linux.
  • mvnw.cmd: Script for Windows.
  • .mvn/wrapper/maven-wrapper.jar: Maven Wrapper executable.
  • .mvn/wrapper/maven-wrapper.properties: Maven Wrapper configuration.

How to Generate the Maven Wrapper

To add the Maven Wrapper to your project, run the following command in the root directory of your project:

mvn -N io.takari:maven:wrapper

This will generate the necessary Maven Wrapper files.

application.properties

The src/main/resources/application.properties file is used to configure various properties of the Spring Boot application.

# ---------------------------------
#    _____ __         __                    ______                          _
#   / ___// /_  ___  / /________  ____     / ____/__  ______________ ______(_)
#   \__ \/ __ \/ _ \/ / ___/ __ \/ __ \   / /_  / _ \/ ___/ ___/ __ `/ ___/ /
#  ___/ / / / /  __/ (__  ) /_/ / / / /  / __/ /  __/ /  / /  / /_/ / /  / /
# /____/_/ /_/\___/_/____/\____/_/ /_/  /_/    \___/_/  /_/   \__,_/_/  /_/
# ---------------------------------
# Currency Conversion API
# Application configuration file (application.properties)
# - Defines the location of the custom banner file
# - Configures the banner variables
# - Configures the H2 datasource
# - Enables the H2 console
# - Configures JPA/Hibernate
# - Defines logging configurations
# - Configures the server port
# - Configures springdoc-openapi
# - Maven project properties
# ---------------------------------

# ---------------------------------
# Defines the location of the custom banner file
# ---------------------------------
spring.banner.location=classpath:banner.txt

# ---------------------------------
# Defines a banner variable for the application version
# ---------------------------------
spring.banner.variable.app_version=${java.version}

# ---------------------------------
# H2 datasource configurations
# ---------------------------------
spring.datasource.url=jdbc:h2:mem:shelson;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=

# ---------------------------------
# Enables the H2 console
# ---------------------------------
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.web-allow-others=true

# ---------------------------------
# JPA/Hibernate configurations
# ---------------------------------
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=true

# ---------------------------------
# Hibernate logging configurations
# ---------------------------------
logging.level.org.hibernate.SQL=OFF
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=OFF

# ---------------------------------
# Spring logging configurations
# ---------------------------------
logging.level.org.springframework.web=ERROR
logging.level.org.springframework.boot=ERROR
logging.level.root=INFO
# logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
# logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n

# ---------------------------------
# Server port
# ---------------------------------
server.port=8080

# ---------------------------------
# springdoc-openapi configurations
# ---------------------------------
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html

# ---------------------------------
# Maven project properties (these will be replaced during resource filtering)
# ---------------------------------
project.name=@project.name@
project.description=@project.description@
project.phase=@project.phase@
# project.basedir=@project.basedir@
springdoc.swagger-ui.enabled=true

# ---------------------------------
# Swagger
# ---------------------------------
api.title=Currency Conversion API
api.description=API for converting currency rates
api.version=1.0
swagger.group=shelson-api
swagger.packages-to-scan=com.shelson
swagger.paths-to-match=/**

Wiki Menu

Wiki Main Page

1. Introduction to the Project

  • Overview: Presentation of the project, highlighting its purpose and the context in which it is embedded.
  • Project Objectives: Enumeration of the main objectives that the project aims to achieve.
  • Scope and Functionalities: Description of the main functionalities offered by the project and its scope of operation.

2. Configuration and Installation

3. Project Structure

  • Folder Structure: Description of the organization of the project directories.
  • Project Architecture: Explanation of the architecture used, including design patterns and technical decisions.

4. Development

  • Development Flow: Description of the development process adopted, including planning, coding, and review stages.
  • Apache Camel Integration: Guide on integrating Apache Camel into the project, including configuration and usage.
  • Contributors and Authors: Recognition of the contributors to the project.
  • Contributions: Guidelines on how to contribute to the project, including code standards and pull request requirements, tips and best practices.
  • Code of Conduct: Behavioral guidelines expected for the project community.

5. API and Documentation

6. Endpoints and Database

  • Endpoint Description: Details of the available API endpoints, including methods, parameters, and usage examples.
  • Database Management: Strategies and practices for efficient management of the database used by the project.

7. Testing

  • Testing Strategies: Approach and methods used to test the software, including unit, integration, and E2E tests.
  • Testing Tools: Description of the testing tools used in the project and how to configure them.

8. CI/CD and Automations

  • CI/CD Pipeline: Explanation of the continuous integration and delivery pipeline, detailing each stage and its function.
  • Automations and Artifact Generation: Description of the automations incorporated into the CI/CD, including documentation generation and build artifacts.

9. Configuration Files

10. Best Practices

11. Legal and Licensing

  • Licensing: Information about the rights and restrictions associated with the use of the software.
  • Terms of Use: Information about the terms and conditions for using the software.

12. Projections and Innovations

  • Future Plans: Discussion on functionalities and improvements considered for future versions of the project.
  • Improvement Proposals: Space for the community to suggest and debate improvements and innovations.

13. Attachments and Useful Links

14. Security

  • Security Policy: Details on the supported versions, reporting vulnerabilities, and general security practices.

Clone this wiki locally