Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-28936

Maven does not enable JPA facet when JPA dependency is defined in pom

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 4.29.1.Final
    • 4.27.0.Final
    • maven
    • None
    • Hide

      1. Create new Dynamic Web Project -> Set target runtime (<none> or wildfly runtime) -> finish

      2. Right click on created project -> Configure -> Convert to Maven Project (Packaging should be set to "war" by default) -> Finish (If runtime was set, "Convert to Maven Dependencies" window should appear, if so - click Finish)

      3. Right click on created project -> New -> Other... -> XML File -> Next -> Put "/src/META-INF" after your project name in "Enter or select the parent folder" field -> set filename to "persistence.xml" -> finish -> replace the content in created xml file with this:

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.2"
         xmlns="https://java.sun.com/xml/ns/persistence" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
              https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/
              https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_2.xsd">
         <persistence-unit name="primary" transaction-type="JTA">
         </persistence-unit>
      </persistence>
      

      save file

      4. Right click created project -> Maven -> Update project.. -> check "Force Update of Snapshots/Releases" -> OK

      5. Right click on created project -> Properties -> Project Facets -> The JPA Facet should be checked (but is not)

      The steps are based on https://github.com/jbosstools/jbosstools-integration-tests/blob/main/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/configurator/JPAConfiguratorTest.java meaning that the provided steps can be obsolete and the JPA Facet behaviour has changed - if this is a case, please let me know

      Show
      1. Create new Dynamic Web Project -> Set target runtime (<none> or wildfly runtime) -> finish 2. Right click on created project -> Configure -> Convert to Maven Project (Packaging should be set to "war" by default) -> Finish (If runtime was set, "Convert to Maven Dependencies" window should appear, if so - click Finish) 3. Right click on created project -> New -> Other... -> XML File -> Next -> Put "/src/META-INF" after your project name in "Enter or select the parent folder" field -> set filename to "persistence.xml" -> finish -> replace the content in created xml file with this: <?xml version= "1.0" encoding= "UTF-8" ?> <persistence version= "2.2" xmlns= "https: //java.sun.com/xml/ns/persistence" xmlns:xsi= "https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" https: //www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/ https: //www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_2.xsd"> <persistence-unit name= "primary" transaction-type= "JTA" > </persistence-unit> </persistence> save file 4. Right click created project -> Maven -> Update project.. -> check "Force Update of Snapshots/Releases" -> OK 5. Right click on created project -> Properties -> Project Facets -> The JPA Facet should be checked (but is not) The steps are based on https://github.com/jbosstools/jbosstools-integration-tests/blob/main/tests/org.jboss.tools.maven.ui.bot.test/src/org/jboss/tools/maven/ui/bot/test/configurator/JPAConfiguratorTest.java meaning that the provided steps can be obsolete and the JPA Facet behaviour has changed - if this is a case, please let me know
    • ---

    Description

      When defining a JPA dependency in pom file of a project, the project does not have the JPA Facet activated.

      Attachments

        Activity

          People

            stephane.bouchet Stephane Bouchet
            rhn-support-lgrossma Lukáš Grossmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: