Spring Roo
  1. Spring Roo
  2. ROO-765

Incorrect maven dependency defined when using Oracle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.0.2.RELEASE
    • Fix Version/s: 1.1.0.M1
    • Component/s: BUILD
    • Labels:
      None

      Description

      When ORACLE is specified as the database in persistence setup the following dependency is added:
      <dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc14</artifactId>
      <version>10.2.0.2</version>
      </dependency>

      Which maven can't resolve: "Missing artifact com.oracle:ojdbc14:jar:10.2.0.2:compile"

      The correct entry is:
      <dependency>
      <groupId>com.oracle.jdbc</groupId>
      <artifactId>com.springsource.oracle.jdbc</artifactId>
      <version>10.2.0.2</version>
      </dependency>

        Issue Links

          Activity

          Hide
          whyBish added a comment -

          org.springframework.roo.addon.jpa/src/main/resources/org.springframework.roo.addon.jpa/dependencies.xml line 25.
          I don't have an Oracle instance to test a patch with.

          Show
          whyBish added a comment - org.springframework.roo.addon.jpa/src/main/resources/org.springframework.roo.addon.jpa/dependencies.xml line 25. I don't have an Oracle instance to test a patch with.
          Hide
          Peter C Miller added a comment -

          You wouldn't need an Oracle instance. You would just need to see a jar actually get downloaded.

          I haven't tried it but my guess is that DB2 has the same problem. Roo uses the SpringSource Enterprise Bundle Repository which has its own naming convension(for OSGI ready bundles?). The dependency currently listed for Oracle uses the maven central groupId and artifactId. See:

          http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.2.0/

          But should use the the one detailed here:
          http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.oracle.jdbc&version=10.2.0.2

          Eg current MySQL dependency defined in org.springframework.roo.addon.jpa/src/main/resources/org.springframework.roo.addon.jpa/dependencies.xml

          <database id="MYSQL">
             <dependency org="com.mysql.jdbc" name="com.springsource.com.mysql.jdbc" rev="5.1.6" />
          </database>
          

          Current Oracle:

          <database id="ORACLE">
             <dependency org="com.oracle" name="ojdbc14" rev="10.2.0.2" />
          </database>
          

          Oracle should be

          <database id="ORACLE">
             <dependency org="com.oracle.jdbc" name="com.springsource.oracle.jdb" rev="10.2.0.2" />
          </database>
          
          Show
          Peter C Miller added a comment - You wouldn't need an Oracle instance. You would just need to see a jar actually get downloaded. I haven't tried it but my guess is that DB2 has the same problem. Roo uses the SpringSource Enterprise Bundle Repository which has its own naming convension(for OSGI ready bundles?). The dependency currently listed for Oracle uses the maven central groupId and artifactId. See: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.2.0/ But should use the the one detailed here: http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.oracle.jdbc&version=10.2.0.2 Eg current MySQL dependency defined in org.springframework.roo.addon.jpa/src/main/resources/org.springframework.roo.addon.jpa/dependencies.xml <database id= "MYSQL" > <dependency org= "com.mysql.jdbc" name= "com.springsource.com.mysql.jdbc" rev= "5.1.6" /> </database> Current Oracle: <database id= "ORACLE" > <dependency org= "com.oracle" name= "ojdbc14" rev= "10.2.0.2" /> </database> Oracle should be <database id= "ORACLE" > <dependency org= "com.oracle.jdbc" name= "com.springsource.oracle.jdb" rev= "10.2.0.2" /> </database>
          Hide
          Stefan Schmidt added a comment -

          In Roo 1.1 M1 we will switched from using the SpringSource Enterprise Bundle repository to Maven Central (based on popular demand). The problem is that Oracle does not post its JDBC drivers to any public Maven repository (AFAIK). Therefore we are installing a token dependency into the generated project pom fully expecting the user to either adjust that dependency manually to point to his correct version or to install the Oracle driver manually into your local repo.

          Not sure if there is much more we can do other than probably document it better in the reference guide.

          Hope this makes sense.

          Show
          Stefan Schmidt added a comment - In Roo 1.1 M1 we will switched from using the SpringSource Enterprise Bundle repository to Maven Central (based on popular demand). The problem is that Oracle does not post its JDBC drivers to any public Maven repository (AFAIK). Therefore we are installing a token dependency into the generated project pom fully expecting the user to either adjust that dependency manually to point to his correct version or to install the Oracle driver manually into your local repo. Not sure if there is much more we can do other than probably document it better in the reference guide. Hope this makes sense.
          Hide
          Peter C Miller added a comment -

          I knew about the switch in 1.1 but this problem exists in 1.0.2 where everything else uses the SpringSource repository.

          I guess if there's never going to be a 1.0.3 this should be marked as "won't fix", but in this version at least it's a bug.

          Also, what about:
          http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.2.0/ojdbc14-10.2.0.2.0.pom

          If you go the token dependency route is it possible to inject a comment along with the dependency?

          Show
          Peter C Miller added a comment - I knew about the switch in 1.1 but this problem exists in 1.0.2 where everything else uses the SpringSource repository. I guess if there's never going to be a 1.0.3 this should be marked as "won't fix", but in this version at least it's a bug. Also, what about: http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.2.0/ojdbc14-10.2.0.2.0.pom If you go the token dependency route is it possible to inject a comment along with the dependency?
          Hide
          Stefan Schmidt added a comment -

          Good point.

          At this stage we have not scheduled a 1.0.3 release but I am marking it for 1.0.3 so it does not get lost.

          Also, if you take a closer look the maven repo you have provided the link to you will notice that it does actually not contain the driver jar file at all, so unfortunately I don't think this will be helpful.

          Cheers,
          Stefan

          Show
          Stefan Schmidt added a comment - Good point. At this stage we have not scheduled a 1.0.3 release but I am marking it for 1.0.3 so it does not get lost. Also, if you take a closer look the maven repo you have provided the link to you will notice that it does actually not contain the driver jar file at all, so unfortunately I don't think this will be helpful. Cheers, Stefan
          Hide
          Peter C Miller added a comment -

          Ah, saw the md5s and just assumed the jar was in there. I guess I usually have it installed in my local repo or Nexus. I'm not sure how much flexibility there is with what you can output in response to these arguments but some hint/tip text in the shell and a comment in the pom as I mentioned previously would probably make this easier on users new to maven.

          Thanks again,
          Peter M

          Show
          Peter C Miller added a comment - Ah, saw the md5s and just assumed the jar was in there. I guess I usually have it installed in my local repo or Nexus. I'm not sure how much flexibility there is with what you can output in response to these arguments but some hint/tip text in the shell and a comment in the pom as I mentioned previously would probably make this easier on users new to maven. Thanks again, Peter M
          Hide
          Stefan Schmidt added a comment -

          With rev 811 I have added a new paragraph to the Roo documentation as well as a log statement (which gets displayed by the shell) which explains the situation for Oracle and DB2 drivers.

          Show
          Stefan Schmidt added a comment - With rev 811 I have added a new paragraph to the Roo documentation as well as a log statement (which gets displayed by the shell) which explains the situation for Oracle and DB2 drivers.

            People

            • Assignee:
              Stefan Schmidt
              Reporter:
              Peter C Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: