为生成的 application.xml 指定环境条目

可以从 JavaEE 6 规范添加环境条目。例如:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
           [...]
           <version>6</version>
           [...]
           <env-entries>
             <env-entry>
               <description>A complete entry.</description>
               <env-entry-name>complete</env-entry-name>
               <env-entry-type>java.lang.Integer</env-entry-type>
               <env-entry-value>4</env-entry-value>
               <lookup-name>java:global/Example</lookup-name>
             </env-entry>
             <env-entry>
               <env-entry-name>no-type</env-entry-name>
               <env-entry-value>4</env-entry-value>
             </env-entry>
             <env-entry>
               <env-entry-name>no-value</env-entry-name>
               <env-entry-type>java.lang.String</env-entry-type>
             </env-entry>
           </env-entries>
        </configuration>
      </plugin>
    </plugins>
  </build>