GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MEAR-282] Support data-source element · Issue #453 · apache/maven-ear-plugin

[MEAR-282] Support data-source element #453

New issue
Copy link
New issue
Copy link
Open
Open
[MEAR-282] Support data-source element#453
Copy link
Labels
enhancementNew feature or requestpriority:majorMajor loss of function

Description

@jira-importer
jira-importer
opened on Jul 15, 2020
Issue body actions

Joeren Haag opened MEAR-282 and commented

Since Version 6 and up to the latest Version of Java/Jakarta EE the data-source element is defined in the Schema of the application.xml ([#1]). So it would be nice to support the data-source element also in the configuration of the maven-ear-plugin. Here is my actual workaround:

  1. enable the generation of application.xml
  2. move the generated application.xml to the source folder src/main/application
  3. disable the generation of application.xml
  4. add the data-source configuration to application.xm

Here is a "simple example" of the data-source element (the example is based on Version 8 of Java EE), like it's look in the application.xml:

<data-source>
  <description><!-- string, optional --></description>
  <name><!-- jndi-name, required --></name>
  <class-name><!-- fqn, optional --></class-name>
  <server-name><!-- string, optional --></server-name>
  <port-number><!-- int, optional --></port-number>
  <database-name><!-- string, optional --></database-name>
  <url><!-- JDBC-url, optional --></url>
  <user><!-- string, optional --></user>
  <password><!-- string, optional --></password>
  <property><!-- optional, multiple -->
    <name><!-- string --></name>
    <value><!-- value --></value>
  </property>
  <login-timeout><!-- integer, optional --></login-timeout>
  <transactional><!-- boolean, optional --></transactional>
  <isolation-level><!-- TRANSACTION_READ_UNCOMMITTED|TRANSACTION_READ_COMMITTED|TRANSACTION_REPEATABLE_READ|TRANSACTION_SERIALIZABLE, optional--></isolation-level>
  <initial-pool-size><!-- integer, optional --></initial-pool-size>
  <max-pool-size><!-- integer, optional --></max-pool-size>
  <min-pool-size><!-- integer, optional --></min-pool-size>
  <max-idle-time><!-- integer, optional --></max-idle-time>
  <max-statements><!-- integer, optional --></max-statements>
</data-source>

—

  • {anchor:1} 1: application-schema for Java EE version 6 - https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/application_6.xsd

1 votes, 3 watchers

Activity

  1. jira-importer
    added
    priority:majorMajor loss of function
    on Jun 9, 2025
  2. elharo
    added
    enhancementNew feature or request
    on Jul 3, 2026
  3. elharo commented on Jul 28, 2026

    @elharo
    elharo
    on Jul 28, 2026
    Contributor
    More actions

    Gemini likes this one:

    This element has been part of the official Java EE (and now Jakarta EE) schema for enterprise applications since version 6.

    This is a highly valid and worthwhile feature request. It represents a gap in the plugin's implementation of the official specification, and resolving it aligns perfectly with the core purpose of the plugin.

    Here is a technical evaluation of why this feature should be implemented:

    1. Specification Alignment: The primary responsibility of the maven-ear-plugin (when configured to generate the deployment descriptor) is to output a strictly compliant application.xml file. The <data-source> element is a standard, defined part of the application_6.xsd (and later) schemas. By lacking support for this element, the plugin is failing to fully implement the specification it is designed to support.
    2. Elimination of Fragile Workarounds: Currently, users who need to define a data source at the EAR level are forced to completely disable the plugin's descriptor generation. They must generate the XML once, copy it to src/main/application/META-INF/application.xml, manually add the <data-source> block, and maintain the file statically going forward. This defeats the purpose of having the plugin dynamically manage module entries and configurations during the build lifecycle.
    3. Infrastructure as Code: Defining standard application resources like data sources within the build configuration (POM) ensures that deployment requirements are version-controlled alongside the build logic.

    Potential Implementation Considerations:
    The only minor drawback to this feature is verbosity. As outlined in the issue, the <data-source> element accepts over a dozen nested properties (e.g., class-name, port-number, initial-pool-size, isolation-level). Implementing this will require adding a complex configuration object to the plugin's Mojo parameters. Consequently, configuring this inside a pom.xml will result in a lengthy XML block.

    However, because this configuration would be strictly optional, it imposes no burden on users who do not need it. Unlike previous requests that sought to modify core build lifecycle mechanics or support proprietary formats, this request asks the plugin to correctly output standard Jakarta EE metadata. It should be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.