EclipseLink 2.7.0 and JPA API 2.2.0 - signature mismatch

前端 未结 10 1595
滥情空心
滥情空心 2020-12-03 04:31

When running a project built by maven with the following dependencies:

        
            org.eclipse.persistence         


        
10条回答
  •  难免孤独
    2020-12-03 05:06

    I'm using gradle in my project build and to solve the OP's problem, which I had as well, I finally used the following working setup.

    dependencies {
    
        testImplementation(group: 'org.eclipse.persistence', name: 'eclipselink', version: '2.7.4') {
            exclude group: 'javax.validation', module: 'validation-api'
            exclude group: 'org.eclipse.persistence', module: 'javax.persistence'
            exclude group: 'org.eclipse.persistence', module: 'commonj.sdo'
            exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
        }
    
        testImplementation(group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.jpa', version: '2.7.4') {
            exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
        }
    
    }
    

    Instead of "testImplementation" you can of course use any dependency type you want or need.

    After reading Sergey's comment I've improved this by just using:

    dependencies {
        testImplementation group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.jpa', version: '2.7.4'
    }
    

    I think the last one is the best solution.

提交回复
热议问题