Annotation Type MavenProperty


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface MavenProperty
    This annotation injects a property from a maven properties file in the annotated field. By default, the properties file is located in META-INF/maven/groupId/artifactId/pom.properties
    Author:
    lhottois (natlantisprog@gmail.com)
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String artifactId
      The artifactId of jar to look for.
      String groupId
      The groupId of the jar file to look for.
      String key
      The key in the maven properties file.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String defaultValue
      The default value to set in case the key does not exist or cannot be loaded.
      boolean failFast
      Flag to fail the configuration process if the key is absent
      int order
      Injection order regarding other annotations.
      String source
      The property source file containing maven properties (by default "pom.properties", as generated by maven archiver).
    • Element Detail

      • key

        String key
        The key in the maven properties file.
        Returns:
        The key in the maven properties file
      • artifactId

        String artifactId
        The artifactId of jar to look for.
        Returns:
        the artifactId
      • groupId

        String groupId
        The groupId of the jar file to look for.
        Returns:
        the groupId
      • source

        String source
        The property source file containing maven properties (by default "pom.properties", as generated by maven archiver).
        Returns:
        The property source file containing maven properties
        Default:
        "pom.properties"
      • defaultValue

        String defaultValue
        The default value to set in case the key does not exist or cannot be loaded.
        Returns:
        the default value to set
        Default:
        ""
      • failFast

        boolean failFast
        Flag to fail the configuration process if the key is absent
        Returns:
        true if the configuration process should fail fast if the key is absent
        Default:
        false
      • order

        int order
        Injection order regarding other annotations.
        Returns:
        injection order regarding other annotations
        Default:
        0