Application configuration

For Axion configuration, use on of the methods described below:

Command line parameters

Use the command line parameters to pass all required parameters on Axion startup.

For example:

java -jar /usr/axion-1.0.0-SNAPSHOT.jar --application.keys.google_analytics=G-123456

Configuration file

Put a file aplicatoin.yml with the required parameters next to axion-1.0.0-SNAPSHOT.jar before executing the jar.

It is enough to add a single required parameter with a value in an aplicatoin.yml, you do not need to state every parameter.

For example:

application:
  paging:
    size: 10

An example of aplicatoin.yml with different parameters and their values:

logging:
  charset:
    console: UTF-8
  level:
    root: info
  config: classpath:configs/logback-spring.xml

server:
  servlet:
    context-path: /
    session:
      cookie:
        http-only: true
  port: 8080
  compression:
    enabled: true
    mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,image/svg+xml
    min-response-size: 512
  http2:
    enabled: true
  error:
    whitelabel:
      enabled: true
  shutdown: graceful

spring:
  profiles:
    active: @spring.profiles.active@
  application:
    name: Axion
  jmx:
    enabled: false
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:postgresql://localhost:5432/axion
    username: axion
    password: secret
    hikari:
      poolName: axion-pool
      auto-commit: false
      minimum-idle: 10
      maximum-pool-size: 100
      max-lifetime: 300000
      validation-timeout: 500
      idle-timeout: 60000
      leak-detection-threshold: 80000
      connection-timeout: 20000
      initialization-fail-timeout: 1
      isolate-internal-queries: false
      allow-pool-suspension: false
      login-timeout: 10000
  messages:
    basename: messages.application
    encoding: UTF-8
    use-code-as-default-message: true
  transaction:
    rollback-on-commit-failure: true
    default-timeout: 30s
  liquibase:
    change-log: database/changelog-master.xml
    label-filter: locale_en
    contexts: data
  thymeleaf:
    prefix: classpath:/templates/
    suffix: .html
    cache: true
  data:
    jpa:
      repositories:
        bootstrap-mode: default
  mvc:
    servlet:
      load-on-startup: 1
  jpa:
    generate-ddl: false
    open-in-view: false
    show-sql: false
    properties:
      hibernate:
        format_sql: false
        hql.bulk_id_strategy: org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy
        order_updates: true
        order_inserts: true
        default_batch_fetch_size: 1000
        enable_lazy_load_no_trans: false
        batch_fetch_style: dynamic
        jdbc:
          time_zone: UTC
          lob.non_contextual_creation: true
          batch_size: 100
          fetch_size: 300
          batch_versioned_data: true
        id.new_generator_mappings: true
        generate_statistics: false
        connection.provider_disables_autocommit: true
        cache:
          use_second_level_cache: false
          use_query_cache: false
    hibernate:
      ddl-auto: validate
  web:
    resources:
      cache:
        cachecontrol:
          max-age: 120
          must-revalidate: true

management:
  server:
    port: 8080
  endpoint:
    health:
      enabled: true
    info:
      enabled: true
    metrics:
      enabled: true
    prometheus:
      enabled: true
  endpoints:
    enabled-by-default: false
    jmx:
      exposure:
        exclude: "*"
    web:
      base-path: /actuator
      exposure:
        include: "health,info,metrics,prometheus"

application:
  group_id: @project.groupId@
  artifact_id: @project.artifactId@
  version: @project.version@
  name: @project.name@
  description: @project.description@
  keys:
    google_analytics:
    yandex_metrika:
  paging:
    page: 1
    size: 10