close

Filter

loading table of contents...

Blueprint Developer Manual / Version 2010

Table Of Contents

4.1.3.3 Application Artifacts

An application artifact is a WAR (web application) file that is ready to be deployed in a servlet container. It consists of one or more component and library artifacts as well as a small layer of code or configuration that glues the components together. Web resources such as image or CSS files might be either directly contained in application artifacts or might be bundled below /META-INF/resources inside a shared library or component artifact.

Application artifacts may contain the following files to configure its components:

  • /WEB-INF/web.xml: Servlet 3.0 web application deployment descriptor, may declare a load order for component web fragments and additional servlet filters, listeners, etc.

  • /WEB-INF/application.xml: Contains additional Spring configuration which is required by the application and not provided by components.

  • /WEB-INF/application.properties: Configures components packaged with the application. Values set here override any default application and component configuration in /WEB-INF/application.xml and /META-INF/coremedia/component-<componentname>.properties.

You can specify additional properties files by defining a comma-separated list of paths in a System or JNDI property with the name propertieslocations.

Application properties are loaded from the following sources, from the highest to the lowest precedence:

  • System properties: Useful for overriding a property value on the command-line. Example:

    $ mvn '-Dmanagement.server.remote.url=
                  service:jmx:jmxmp://localhost:6666' tomcat7:run

  • JNDI context: Allows deployers to override application properties without modifying the WAR artifact. To set the property management.server.remote.url via the JNDI context, its value may be added to the application environment in the application's /WEB-INF/web.xml or in Tomcat's context configuration:

    <env-entry>
      <env-entry-name>
        management.server.remote.url
      </env-entry-name>
      <env-entry-value>
        service:jmx:jmxmp://localhost:6666
      </env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

    Example 4.2. Setting an environment property in web.xml


    <Context>
      <!-- ... -->
    
      <Environment
        name="management.server.remote.url"
        value="service:jmx:jmxmp://localhost:6666"
        type="java.lang.String"
        override="true"/>
    
      <!-- ... -->
    </Context>

    Example 4.3. Setting an environment property in the context configuration


  • /WEB-INF/application.properties: Build-time configuration of application properties.

  • /WEB-INF/component-*.properties: Like application.properties, but allows grouping of properties by component.

  • classpath:/META-INF/coremedia/component-*.properties: Default component configurations provided by the author of the component. These files should not be modified to configure components for use in a particular application. Instead, their values should be overridden in the application artifact in the files /WEB-INF/component-*.properties or /WEB-INF/application.properties.

Search Results

Table Of Contents