gradlenetbeansmetamodelnetbeans-8.2

CompileJava failed to find metamodel and failed


I've has a project for at least a year and would compile fine. now when i try to compile the metamodels are missing and the compilejava task is failing. I'm not sure if the issues is because there is a version issue or what. keep in mind that before hand i had no issue with running the build with the current gradle build script and project file structure.

the code is in java with netBeans: Product Version: NetBeans IDE 8.2 (Build 201609300101) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2 Java: 1.8.0_171; Java HotSpot(TM) 64-Bit Server VM 25.171-b11 Runtime: Java(TM) SE Runtime Environment 1.8.0_171-b11 System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb)

Gradle Support 1.4.4

i've attempted to "set the generated path" but that didn't work. i've also tried to create me own copies of the metamodel class then reference it in the dynamic query builder. it would compile but the when i tested the query and i keep getting a null pointer exception.

if i ctrl click the metamodel in the class file using the metamodel it loads the metamodel class file i think there is some issue with the generator creating the metamodel object on compile.

apply plugin: 'java'
apply plugin: 'war'

sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

war.archiveName "ApplicationWarehouseService.war"
war {
    webInf {from 'src/main/resources/application.xml' }
}

if (!hasProperty('mainClass')) {
    ext.mainClass = 'test'
}

repositories {
    mavenCentral()
    maven {
        url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/"
    }
}

dependencies {
compile 'javax.servlet:javax.servlet-api:4.0.0'
compile 'commons-validator:commons-validator:1.6'

compile 'org.springframework:spring-webmvc:5.0.5.RELEASE'
compile 'org.springframework.security:spring-security-web:5.0.4.RELEASE'
compile 'org.springframework.security:spring-security-config:5.0.4.RELEASE'
compile 'org.springframework:spring-jdbc:5.1.6.RELEASE'
compile 'org.springframework:spring-aop:5.1.6.RELEASE'
compile 'org.springframework:spring-context:5.1.6.RELEASE'
compile 'org.springframework:spring-context-support:5.1.6.RELEASE'

compile 'org.springframework.data:spring-data-jpa:2.1.6.RELEASE'
compile 'org.springframework:spring-orm:5.1.6.RELEASE'
compile 'com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8'
compile 'org.hibernate:hibernate:3.5.4-Final'
compile 'org.hibernate:hibernate-core:5.4.2.Final'
compile 'org.hibernate:hibernate-jpamodelgen:5.4.3.Final'

compile 'org.aspectj:aspectjrt:1.9.0'
compile 'org.aspectj:aspectjweaver:1.9.0'
compile 'org.apache.tomcat:tomcat-jdbc:9.0.7'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
compile 'commons-fileupload:commons-fileupload:1.3.3'
compile 'javax.mail:javax.mail-api:1.6.1'

compile 'javax:javaee-api:8.0'
compile 'javax.servlet:jstl:1.2'
compile 'org.hibernate.validator:hibernate-validator:6.0.9.Final'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile files('C:/Program Files (x86)/Microsoft JDBC Driver 4.1 for SQL Server/sqljdbc_4.1/enu/jre7/sqljdbc41.jar')
//compile 'com.lowagie:itext:4.2.2'
compile 'com.lowagie:itext:2.1.7'
compile 'net.sf.jasperreports:jasperreports:6.1.0'
//    compile 'com.itextpdf:itextpdf:5.5.13'
//    compile 'net.sf.jasperreports:jasperreports:6.5.1'
compile 'javax.money:money-api-bp:1.0'

compile 'org.json:json:20180130'

compile 'javax.xml.bind:jaxb-api:2.3.0'



compile group: 'ar.com.fdvs', name: 'DynamicJasper', version: '5.1.1'
compile group: 'ar.com.fdvs', name: 'DynamicJasper-core-fonts', version: '1.0'

testCompile group: 'junit', name: 'junit', version: '4.10'
testCompile 'org.springframework:spring-test:5.0.5.RELEASE'
}

configurations.all*.dependencies*.withType(ModuleDependency)*.each {
    it.exclude group: "org.bouncycastle", module: "*"
    it.exclude group: "bouncycastle", module: "*"
}

ideally i'd like to have my project create the metamodels and compile successfully.


Solution

  • I found the Solution I Added

    annotationProcessor('org.hibernate:hibernate-jpamodelgen:5.4.3.Final')
    

    in the dependencies section. Compiled just fine.