Reputation: 53
I copied my project with full dependencies and added all modules into IntelliJ, but now maven does not recognize some of the dependencies.
When I validate or install dependencies, I see errors like this:
[ERROR] Some problems were encountered while processing the POMs:
'dependencies.dependency.artifactId' for com.oracle:${hibernate.oracle.jdbcDriver.artifactId}:jar with value '${hibernate.oracle.jdbcDriver.artifactId}' does not match a valid id pattern. @ line 170, column 16
'dependencies.dependency.version' for com.oracle:${hibernate.oracle.jdbcDriver.artifactId}:jar must be a valid version but is '${hibernate.oracle.jdbcDriver.version}'. @ line 171, column 13
'dependencies.dependency.version' for com.oracle:orai18n:jar must be a valid version but is '${hibernate.oracle.jdbcDriver.version}'. @ line 176, column 13
How can I fix this ?
Upvotes: 0
Views: 687
Reputation: 1338
JDBC driver and other companion jars are on central maven. Why not use the GAV of those directly? The below will download ojdbc8.jar and other companion jars such as orai18n.jar. Check out maven central guide for more details.
<dependencies>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8-production</artifactId>
<version>21.1.0.0</version>
<type>pom</type>
</dependency>
</dependencies>
Upvotes: 1
Reputation: 5294
If you post your actual pom xml (if you can) it's better than posting the image but in any case your problem is the versions are not being resolved because they are defined with properties.
You need to define properties for the missing artifacts in the error, by adding some values inside the <properties>
node of your pom.
So basically you need to plug in two values, one for the oracle jdbc artifact id and another for the version.
<properties>
<spring.version>5.1.6.RELEASE</spring.version>
<hibernate.version>5.4.2.Final</hibernate.version>
<cxf.version>3.1.16</cxf.version>
<log4j.version>2.12.1</log4j.version>
<hibernate.oracle.jdbcDriver.artifactId> version goes here </hibernate.oracle.jdbcDriver.artifactId>
<hibernate.oracle.jdbcDriver.version> version goes here </hibernate.oracle.jdbcDriver.version>
</properties>
Upvotes: 3