Skip to content

Instantly share code, notes, and snippets.

@mraible
Last active April 3, 2019 21:28
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mraible/716f4d2ab205c0e747d51119fc5d9cd8 to your computer and use it in GitHub Desktop.
Save mraible/716f4d2ab205c0e747d51119fc5d9cd8 to your computer and use it in GitHub Desktop.
JHipster v5 with Java 10

Thanks to Josh Long's Java 10 blog post for instructions!

  1. Download and install Java 10. Make sure it's the version used when you run java -version.

  2. Clone the JHipster project's master branch:

    git clone https://github.com/jhipster/generator-jhipster.git
    
  3. In the cloned directory, run npm link.

  4. Create a new directory and project in it by running jhipster. Choose Maven as your build tool.

  5. Modify pom.xml:

    1. Change java.version to be "10".

    2. Confirm you have a dependency on JAXB.

      <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
      </dependency>
    3. Change the maven-enforcer-plugin to remove the <requireJavaVersion> block:

      <requireJavaVersion>
          <message>You are running an incompatible version of Java. JHipster requires JDK ${java.version}</message>
          <version>[1.8,1.9)</version>
      </requireJavaVersion>
  6. Download and install IntelliJ IDEA 2018.1.

  7. Open the project in IntelliJ, add Java 10 as an SDK, and run the Application.java class.

  8. Enjoy the sweet smell of success! 🤓

@djselzlein
Copy link

djselzlein commented May 23, 2018

Hi there, thank your for these instructions!

Even though I added the 'jaxb-api' dependency to my project (JHipster 5.0.0.beta-1) I keep getting:
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException: javax.xml.bind.JAXBException
when running ./mvnw clean compile

Could you please help me? Would you have any working example project using JHipster 5 and Java 9 or 10?

@jdlee726
Copy link

comment out hibernate-jpamodelgen from annotationProcessorPaths, just worked for me. (sorry for not good at english.)

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!-- For JPA static metamodel generation -->
<!-- comment out the follwoings
                        <path>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>${hibernate.version}</version>
                        </path>
-->

                    </annotationProcessorPaths>
                </configuration>
            </plugin>

@jdlee726
Copy link

I also changed maven-enforcer-plugin with less intrusive way as the followings.

                        <requireJavaVersion>
                            <!-- Until JHipster supports JDK 9 -->
                            <message>You are running an incompatible version of Java. JHipster requires JDK ${java.version}</message>
                            <version>[${java.version},)</version>
                        </requireJavaVersion>

@djselzlein
Copy link

Thank you a lot @jdlee726
I did as you recommend, but now I am getting compilation error on my _Entity_QueryServices.
Since I use Specifications from Spring Data, as generated when you choose to filter your resources on JHipster entity generator, I need the hibernate-jpamodelgen annotation processor to be executed.
Would you know of any way to make it work in this scenario?

@rcsoyer
Copy link

rcsoyer commented May 28, 2018

Same problem in here

@djselzlein
Copy link

It turns out it was some Java 9 compatibility problem with hibernate-jpamodelgen@5.2.16.Final. Once I upgraded to Hibernate version 5.3.1.Final it started to compile again. Registering here for others future reference.

@djselzlein
Copy link

@rcsoyer I have posted a question on StackOverflow with this issue and the same solution I just posted here. I hope it helps.

@William-Michael-Russell

@mraible where is the best place to look up when Java 10 would be officially supported in the generator?

@antarus
Copy link

antarus commented Jun 26, 2018

@williamrussellajb
jhipster supports the LTS version of Java. The next LTS will be the 11th.
With jhipster 5.0.1 I had to add this configuration to the plugin compiler

<fork> true </ fork> <CompilerArgs> <arg> -J - -add-modules </arg> <arg> -Jjava.xml.bind </arg> </compilerArgs>

And set the property hibernate.version 5.3.1.Final

@HoYongLee230
Copy link

HoYongLee230 commented Jul 7, 2018

Can confirm that hibernate-jpamodelgen is the problem. I use Java 10 and kept getting java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException: javax.xml.bind.JAXBException with mvnw, it wasn't until I added 5.3.1.Final to hibernate-jpamodelgen on my pom.xml that it worked.

@rcsoyer
Copy link

rcsoyer commented Aug 10, 2018

I still have the same problem.

I added

<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>2.3.0</version>
		</dependency>

and

<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-jpamodelgen</artifactId>
			<version>5.3.4.Final</version>
		</dependency>

@rcsoyer
Copy link

rcsoyer commented Aug 11, 2018

I followed all the instructions but I still have “NoClassDefFoundException”. I also did what was described in this article.

[INFO] — — apt-maven-plugin:1.1.3:process (default) @ servicos-juridicos — -

[INFO]

[INFO] — — maven-compiler-plugin:3.7.0:compile (default-compile) @ servicos-juridicos — -

[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/hibernate/hibernate-jpamodelgen/5.3.1.Final/hibernate-jpamodelgen-5.3.1.Final.pom

[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/hibernate/hibernate-jpamodelgen/5.3.1.Final/hibernate-jpamodelgen-5.3.1.Final.pom (1.9 kB at 262 B/s)

[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/hibernate/hibernate-jpamodelgen/5.3.1.Final/hibernate-jpamodelgen-5.3.1.Final.jar

[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/hibernate/hibernate-jpamodelgen/5.3.1.Final/hibernate-jpamodelgen-5.3.1.Final.jar (182 kB at 210 kB/s)

[INFO] Changes detected — recompiling the module!

[INFO] Compiling 151 source files to /home/rcsoyer/Development/servicosJuridicos/target/classes

[INFO] — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

[INFO] BUILD FAILURE

[INFO] — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

[INFO] Total time: 01:46 min

[INFO] Finished at: 2018–08–11T01:48:25–03:00

[INFO] — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project servicos-juridicos: Fatal error compiling: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException: javax.xml.bind.JAXBException -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Any idea? For those who could do it right, can you show your complete pom file?

This is mine pom:


4.0.0

<groupId>com.rcsoyer.servicosjuridicos</groupId>
<artifactId>servicos-juridicos</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Servicos Juridicos</name>

<repositories>
	<!-- jhipster-needle-maven-repository -->
</repositories>

<properties>
	<!-- Build properties -->
	<maven.version>3.0.0</maven.version>
	<java.version>10</java.version>
	<scala.version>2.12.6</scala.version>
	<node.version>v8.11.3</node.version>
	<yarn.version>v1.6.0</yarn.version>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
	<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
	<maven.compiler.source>${java.version}</maven.compiler.source>
	<maven.compiler.target>${java.version}</maven.compiler.target>
	<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
	<m2e.apt.activation>jdt_apt</m2e.apt.activation>
	<run.addResources>false</run.addResources>
	<!-- These remain empty unless the corresponding profile is active -->
	<profile.no-liquibase />
	<profile.swagger />

	<!-- Dependency versions -->
	<jhipster-dependencies.version>2.0.14</jhipster-dependencies.version>
	<!-- The spring-boot version should match the one managed by https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
	<spring-boot.version>2.0.3.RELEASE</spring-boot.version>
	<!-- The hibernate version should match the one managed by https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
	<hibernate.version>5.3.1.Final</hibernate.version>
	<!-- The javassist version should match the one managed by https://mvnrepository.com/artifact/org.hibernate/hibernate-core/${hibernate.version} -->
	<javassist.version>3.22.0-GA</javassist.version>
	<!-- The liquibase version should match the one managed by https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
	<liquibase.version>3.5.5</liquibase.version>
	<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
	<validation-api.version>2.0.1.Final</validation-api.version>
	<mapstruct.version>1.2.0.Final</mapstruct.version>

	<!-- Plugin versions -->
	<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
	<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
	<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
	<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
	<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
	<maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
	<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
	<dockerfile-maven-plugin.version>1.4.3</dockerfile-maven-plugin.version>
	<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
	<jacoco-maven-plugin.version>0.8.1</jacoco-maven-plugin.version>
	<scala-maven-plugin.version>3.4.1</scala-maven-plugin.version>
	<sonar-maven-plugin.version>3.4.0.905</sonar-maven-plugin.version>
	<openapi-generator-maven-plugin.version>3.0.1</openapi-generator-maven-plugin.version>

	<!-- Sonar properties -->
	<sonar.exclusions>src/main/webapp/content/**/*.*,
		src/main/webapp/i18n/*.js, target/www/**/*.*</sonar.exclusions>
	<sonar.issue.ignore.multicriteria>S3437,UndocumentedApi,BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria>
	<!-- Rule https://sonarcloud.io/coding_rules?open=Web%3ABoldAndItalicTagsCheck&rule_key=Web%3ABoldAndItalicTagsCheck 
		is ignored. Even if we agree that using the "i" tag is an awful practice, 
		this is what is recommended by http://fontawesome.io/examples/ -->
	<sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>src/main/webapp/app/**/*.*</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.resourceKey>
	<sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>Web:BoldAndItalicTagsCheck</sonar.issue.ignore.multicriteria.BoldAndItalicTagsCheck.ruleKey>
	<!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 
		is ignored, as a JPA-managed field cannot be transient -->
	<sonar.issue.ignore.multicriteria.S3437.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.S3437.resourceKey>
	<sonar.issue.ignore.multicriteria.S3437.ruleKey>squid:S3437</sonar.issue.ignore.multicriteria.S3437.ruleKey>
	<!-- Rule https://sonarcloud.io/coding_rules?open=squid%3AUndocumentedApi&rule_key=squid%3AUndocumentedApi 
		is ignored, as we want to follow "clean code" guidelines and classes, methods 
		and arguments names should be self-explanatory -->
	<sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>src/main/java/**/*</sonar.issue.ignore.multicriteria.UndocumentedApi.resourceKey>
	<sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>squid:UndocumentedApi</sonar.issue.ignore.multicriteria.UndocumentedApi.ruleKey>
	<sonar.jacoco.reportPaths>${project.testresult.directory}/coverage/jacoco/jacoco.exec</sonar.jacoco.reportPaths>
	<sonar.java.codeCoveragePlugin>jacoco</sonar.java.codeCoveragePlugin>
	<sonar.testExecutionReportPaths>${project.testresult.directory}/jest/TESTS-results-sonar.xml</sonar.testExecutionReportPaths>
	<sonar.typescript.lcov.reportPaths>${project.testresult.directory}/lcov.info</sonar.typescript.lcov.reportPaths>
	<sonar.sources>${project.basedir}/src/main/</sonar.sources>
	<sonar.surefire.reportsPath>${project.testresult.directory}/surefire-reports</sonar.surefire.reportsPath>
	<sonar.tests>${project.basedir}/src/test/</sonar.tests>
	<lombok.version>1.18.2</lombok.version>
	<asm.version>6.1.1</asm.version>
	<!-- jhipster-needle-maven-property -->
</properties>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>io.github.jhipster</groupId>
			<artifactId>jhipster-dependencies</artifactId>
			<version>${jhipster-dependencies.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
		<!-- jhipster-needle-maven-add-dependency-management -->
	</dependencies>
</dependencyManagement>

<dependencies>
	<dependency>
		<groupId>io.github.jhipster</groupId>
		<artifactId>jhipster-framework</artifactId>
	</dependency>

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-cache</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-core</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-annotation</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-json</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-jcache</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-jvm</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-servlet</artifactId>
	</dependency>
	<dependency>
		<groupId>io.dropwizard.metrics</groupId>
		<artifactId>metrics-servlets</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.datatype</groupId>
		<artifactId>jackson-datatype-hibernate5</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.datatype</groupId>
		<artifactId>jackson-datatype-hppc</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.datatype</groupId>
		<artifactId>jackson-datatype-jsr310</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.datatype</groupId>
		<artifactId>jackson-datatype-json-org</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.module</groupId>
		<artifactId>jackson-module-afterburner</artifactId>
	</dependency>
	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.jayway.jsonpath</groupId>
		<artifactId>json-path</artifactId>
		<scope>test</scope>
		<!-- parent POM declares this dependency in default (compile) scope -->
	</dependency>
	<dependency>
		<groupId>io.springfox</groupId>
		<artifactId>springfox-swagger2</artifactId>
	</dependency>
	<dependency>
		<groupId>io.springfox</groupId>
		<artifactId>springfox-bean-validators</artifactId>
	</dependency>
	<dependency>
		<groupId>com.mattbertolini</groupId>
		<artifactId>liquibase-slf4j</artifactId>
	</dependency>
	<dependency>
		<groupId>com.ryantenney.metrics</groupId>
		<artifactId>metrics-spring</artifactId>
	</dependency>
	<dependency>
		<groupId>com.zaxxer</groupId>
		<artifactId>HikariCP</artifactId>
	</dependency>
	<dependency>
		<groupId>commons-io</groupId>
		<artifactId>commons-io</artifactId>
	</dependency>
	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-lang3</artifactId>
	</dependency>
	<dependency>
		<groupId>javax.cache</groupId>
		<artifactId>cache-api</artifactId>
	</dependency>
	<dependency>
		<groupId>org.assertj</groupId>
		<artifactId>assertj-core</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.ehcache</groupId>
		<artifactId>ehcache</artifactId>
	</dependency>
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-jcache</artifactId>
	</dependency>
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-jpamodelgen</artifactId>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.hibernate</groupId>
		<artifactId>hibernate-envers</artifactId>
	</dependency>
	<dependency>
		<groupId>org.hibernate.validator</groupId>
		<artifactId>hibernate-validator</artifactId>
	</dependency>
	<dependency>
		<groupId>org.liquibase</groupId>
		<artifactId>liquibase-core</artifactId>
	</dependency>
	<dependency>
		<groupId>net.logstash.logback</groupId>
		<artifactId>logstash-logback-encoder</artifactId>
	</dependency>
	<dependency>
		<groupId>org.postgresql</groupId>
		<artifactId>postgresql</artifactId>
	</dependency>
	<dependency>
		<groupId>org.mapstruct</groupId>
		<artifactId>mapstruct-jdk8</artifactId>
		<version>${mapstruct.version}</version>
	</dependency>
	<dependency>
		<groupId>org.mapstruct</groupId>
		<artifactId>mapstruct-processor</artifactId>
		<version>${mapstruct.version}</version>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-configuration-processor</artifactId>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-loader-tools</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-aop</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-jpa</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-logging</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-mail</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-security</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-thymeleaf</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.zalando</groupId>
		<artifactId>problem-spring-web</artifactId>
	</dependency>
	<dependency>
		<groupId>io.jsonwebtoken</groupId>
		<artifactId>jjwt</artifactId>
	</dependency>
	<!-- Spring Cloud -->
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-config</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-spring-service-connector</artifactId>
	</dependency>
	<!-- Security -->
	<dependency>
		<groupId>org.springframework.security</groupId>
		<artifactId>spring-security-data</artifactId>
	</dependency>
	<!-- jhipster-needle-maven-add-dependency -->

	<!-- rcsoyer - dependências adiconadas pós criação do projeto -->
	<dependency>
		<groupId>io.vavr</groupId>
		<artifactId>vavr</artifactId>
		<version>0.9.2</version>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>com.querydsl</groupId>
		<artifactId>querydsl-apt</artifactId>
	</dependency>
	<dependency>
		<groupId>com.querydsl</groupId>
		<artifactId>querydsl-jpa</artifactId>
	</dependency>
	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-collections4</artifactId>
		<version>4.1</version>
	</dependency>
	<dependency>
		<groupId>javax.xml.bind</groupId>
		<artifactId>jaxb-api</artifactId>
	</dependency>
	<dependency>
		<groupId>org.glassfish.jaxb</groupId>
		<artifactId>jaxb-runtime</artifactId>
		<version>2.3.0</version>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>javax.activation</groupId>
		<artifactId>javax.activation-api</artifactId>
		<version>1.2.0</version>
	</dependency>
	<!-- rcsoyer custom dependencies -->
</dependencies>

<build>
	<defaultGoal>spring-boot:run</defaultGoal>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>${maven-compiler-plugin.version}</version>
			<configuration>
				<release>${java.version}</release>
				<annotationProcessorPaths>
					<path>
						<groupId>org.mapstruct</groupId>
						<artifactId>mapstruct-processor</artifactId>
						<version>${mapstruct.version}</version>
					</path>
					<!-- For JPA static metamodel generation -->
					<path>
						<groupId>org.hibernate</groupId>
						<artifactId>hibernate-jpamodelgen</artifactId>
						<version>${hibernate.version}</version>
					</path>
					<path>
						<groupId>org.projectlombok</groupId>
						<artifactId>lombok</artifactId>
						<version>${lombok.version}</version>
					</path>
				</annotationProcessorPaths>
			</configuration>
			<dependencies>
				<dependency>
					<groupId>org.ow2.asm</groupId>
					<artifactId>asm</artifactId>
					<version>${asm.version}</version>
				</dependency>
			</dependencies>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-eclipse-plugin</artifactId>
			<version>${maven-eclipse-plugin.version}</version>
			<configuration>
				<downloadSources>true</downloadSources>
				<downloadJavadocs>true</downloadJavadocs>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-enforcer-plugin</artifactId>
			<version>${maven-enforcer-plugin.version}</version>
			<executions>
				<execution>
					<id>enforce-versions</id>
					<goals>
						<goal>enforce</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<rules>
					<requireMavenVersion>
						<message>You are running an older version of Maven. JHipster
							requires at least Maven ${maven.version}</message>
						<version>[${maven.version},)</version>
					</requireMavenVersion>
					<!-- <requireJavaVersion> -->
					<!-- Until JHipster supports JDK 9 -->
					<!-- <message>You are running an incompatible version of Java. JHipster 
						requires JDK ${java.version}</message> <version>[1.8,1.9)</version> </requireJavaVersion> -->
				</rules>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-resources-plugin</artifactId>
			<version>${maven-resources-plugin.version}</version>
			<executions>
				<execution>
					<id>default-resources</id>
					<phase>validate</phase>
					<goals>
						<goal>copy-resources</goal>
					</goals>
					<configuration>
						<outputDirectory>target/classes</outputDirectory>
						<useDefaultDelimiters>false</useDefaultDelimiters>
						<delimiters>
							<delimiter>#</delimiter>
						</delimiters>
						<resources>
							<resource>
								<directory>src/main/resources/</directory>
								<filtering>true</filtering>
								<includes>
									<include>config/*.yml</include>
								</includes>
							</resource>
							<resource>
								<directory>src/main/resources/</directory>
								<filtering>false</filtering>
								<excludes>
									<exclude>config/*.yml</exclude>
								</excludes>
							</resource>
						</resources>
					</configuration>
				</execution>
				<execution>
					<id>docker-resources</id>
					<phase>validate</phase>
					<goals>
						<goal>copy-resources</goal>
					</goals>
					<configuration>
						<outputDirectory>target/</outputDirectory>
						<resources>
							<resource>
								<directory>src/main/docker/</directory>
								<filtering>false</filtering>
								<excludes>
									<exclude>**/*.yml</exclude>
								</excludes>
							</resource>
						</resources>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>${maven-surefire-plugin.version}</version>
			<configuration>
				<!-- Force alphabetical order to have a reproducible build -->
				<runOrder>alphabetical</runOrder>
			</configuration>
			<dependencies>
				<dependency>
					<groupId>org.ow2.asm</groupId>
					<artifactId>asm</artifactId>
					<version>${asm.version}</version>
				</dependency>
			</dependencies>
		</plugin>
		<plugin>
			<groupId>org.jacoco</groupId>
			<artifactId>jacoco-maven-plugin</artifactId>
			<version>${jacoco-maven-plugin.version}</version>
			<executions>
				<execution>
					<id>pre-unit-tests</id>
					<goals>
						<goal>prepare-agent</goal>
					</goals>
					<configuration>
						<!-- Sets the path to the file which contains the execution data. -->
						<destFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</destFile>
					</configuration>
				</execution>
				<!-- Ensures that the code coverage report for unit tests is created 
					after unit tests have been run -->
				<execution>
					<id>post-unit-test</id>
					<phase>test</phase>
					<goals>
						<goal>report</goal>
					</goals>
					<configuration>
						<dataFile>${project.testresult.directory}/coverage/jacoco/jacoco.exec</dataFile>
						<outputDirectory>${project.testresult.directory}/coverage/jacoco</outputDirectory>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.sonarsource.scanner.maven</groupId>
			<artifactId>sonar-maven-plugin</artifactId>
			<version>${sonar-maven-plugin.version}</version>
		</plugin>
		<plugin>
			<groupId>org.liquibase</groupId>
			<artifactId>liquibase-maven-plugin</artifactId>
			<version>${liquibase.version}</version>
			<configuration>
				<changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
				<diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
				<driver>org.postgresql.Driver</driver>
				<url>jdbc:postgresql://localhost:5432/servicosJuridicos</url>
				<defaultSchemaName></defaultSchemaName>
				<username>servicosJuridicos</username>
				<password></password>
				<referenceUrl>hibernate:spring:com.rcsoyer.servicosjuridicos.domain?dialect=org.hibernate.dialect.PostgreSQL82Dialect&amp;hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&amp;hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
				<verbose>true</verbose>
				<logging>debug</logging>
			</configuration>
			<dependencies>
				<dependency>
					<groupId>org.javassist</groupId>
					<artifactId>javassist</artifactId>
					<version>${javassist.version}</version>
				</dependency>
				<dependency>
					<groupId>org.liquibase.ext</groupId>
					<artifactId>liquibase-hibernate5</artifactId>
					<version>${liquibase-hibernate5.version}</version>
				</dependency>
				<dependency>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-data-jpa</artifactId>
					<version>${spring-boot.version}</version>
				</dependency>
				<dependency>
					<groupId>javax.validation</groupId>
					<artifactId>validation-api</artifactId>
					<version>${validation-api.version}</version>
				</dependency>
			</dependencies>
		</plugin>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<version>${spring-boot.version}</version>
			<executions>
				<execution>
					<goals>
						<goal>repackage</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<mainClass>${start-class}</mainClass>
				<executable>true</executable>
				<fork>true</fork>
				<!-- Enable the line below to have remote debugging of your application 
					on port 5005 <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments> -->
			</configuration>
		</plugin>
		<plugin>
			<groupId>com.spotify</groupId>
			<artifactId>dockerfile-maven-plugin</artifactId>
			<version>${dockerfile-maven-plugin.version}</version>
			<executions>
				<!-- Uncomment the section below to build the docker image with mvn 
					package and and push it with mvn deploy <execution> <id>default</id> <goals> 
					<goal>build</goal> <goal>push</goal> </goals> </execution> -->
				<execution>
					<id>tag-latest</id>
					<phase>none</phase>
					<goals>
						<goal>build</goal>
						<goal>tag</goal>
						<goal>push</goal>
					</goals>
				</execution>
				<execution>
					<id>version</id>
					<phase>none</phase>
					<goals>
						<goal>build</goal>
						<goal>tag</goal>
						<goal>push</goal>
					</goals>
					<configuration>
						<tag>${project.version}</tag>
					</configuration>
				</execution>
				<execution>
					<id>commit</id>
					<phase>none</phase>
					<goals>
						<goal>build</goal>
						<goal>tag</goal>
						<goal>push</goal>
					</goals>
					<configuration>
						<tag>${git.commit.id.describe}</tag>
					</configuration>
				</execution>
			</executions>
			<configuration>
				<repository>servicosjuridicos</repository>
				<contextDirectory>${project.build.directory}</contextDirectory>
			</configuration>
		</plugin>
		<plugin>
			<!-- Plugin that provides API-first development using openapi-generator 
				to generate Spring-MVC endpoint stubs at compile time from an OpenAPI definition 
				file -->
			<groupId>org.openapitools</groupId>
			<artifactId>openapi-generator-maven-plugin</artifactId>
			<version>${openapi-generator-maven-plugin.version}</version>
			<executions>
				<execution>
					<goals>
						<goal>generate</goal>
					</goals>
					<configuration>
						<inputSpec>${project.basedir}/src/main/resources/swagger/api.yml</inputSpec>
						<generatorName>spring</generatorName>
						<apiPackage>com.rcsoyer.servicosjuridicos.web.api</apiPackage>
						<modelPackage>com.rcsoyer.servicosjuridicos.web.api.model</modelPackage>
						<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
						<configOptions>
							<delegatePattern>true</delegatePattern>
						</configOptions>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<!-- jhipster-needle-maven-add-plugin -->
		<plugin>
			<groupId>com.mysema.maven</groupId>
			<artifactId>apt-maven-plugin</artifactId>
			<version>1.1.3</version>
			<executions>
				<execution>
					<phase>generate-sources</phase>
					<goals>
						<goal>process</goal>
					</goals>
					<configuration>
						<outputDirectory>target/generated-sources/querydsl</outputDirectory>
						<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
					</configuration>
				</execution>
			</executions>
			<dependencies>
				<dependency>
					<groupId>com.querydsl</groupId>
					<artifactId>querydsl-apt</artifactId>
					<version>4.2.1</version>
				</dependency>
			</dependencies>
		</plugin>
	</plugins>
	<pluginManagement>
		<plugins>
			<!-- This plugin's configuration is used to store Eclipse m2e settings 
				only. It has no influence on the Maven build itself. Remove when the m2e 
				plugin can correctly bind to Maven lifecycle -->
			<plugin>
				<groupId>org.eclipse.m2e</groupId>
				<artifactId>lifecycle-mapping</artifactId>
				<version>1.0.0</version>
				<configuration>
					<lifecycleMappingMetadata>
						<pluginExecutions>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.jacoco</groupId>
									<artifactId>
										jacoco-maven-plugin
									</artifactId>
									<versionRange>
										${jacoco-maven-plugin.version}
									</versionRange>
									<goals>
										<goal>prepare-agent</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>com.github.eirslett</groupId>
									<artifactId>frontend-maven-plugin</artifactId>
									<versionRange>${frontend-maven-plugin.version}</versionRange>
									<goals>
										<goal>install-node-and-yarn</goal>
										<goal>yarn</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.openapitools</groupId>
									<artifactId>openapi-generator-maven-plugin</artifactId>
									<versionRange>${openapi-generator-maven-plugin.version}</versionRange>
									<goals>
										<goal>generate</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
						</pluginExecutions>
					</lifecycleMappingMetadata>
				</configuration>
			</plugin>
		</plugins>
	</pluginManagement>
</build>
<profiles>
	<profile>
		<id>no-liquibase</id>
		<properties>
			<profile.no-liquibase>,no-liquibase</profile.no-liquibase>
		</properties>
	</profile>
	<profile>
		<id>swagger</id>
		<properties>
			<profile.swagger>,swagger</profile.swagger>
		</properties>
	</profile>
	<profile>
		<id>webpack</id>
		<build>
			<plugins>
				<plugin>
					<groupId>com.github.eirslett</groupId>
					<artifactId>frontend-maven-plugin</artifactId>
					<version>${frontend-maven-plugin.version}</version>
					<executions>
						<execution>
							<id>install node and yarn</id>
							<goals>
								<goal>install-node-and-yarn</goal>
							</goals>
							<configuration>
								<nodeVersion>${node.version}</nodeVersion>
								<yarnVersion>${yarn.version}</yarnVersion>
							</configuration>
						</execution>
						<execution>
							<id>webpack build dev</id>
							<goals>
								<goal>yarn</goal>
							</goals>
							<phase>generate-resources</phase>
							<configuration>
								<arguments>run webpack:build</arguments>
								<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>
	<profile>
		<id>dev</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-undertow</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-devtools</artifactId>
				<optional>true</optional>
			</dependency>
		</dependencies>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>${maven-war-plugin.version}</version>
					<configuration>
						<failOnMissingWebXml>false</failOnMissingWebXml>
						<warSourceDirectory>target/www/</warSourceDirectory>
						<webResources>
							<resource>
								<directory>src/main/webapp</directory>
								<includes>
									<include>WEB-INF/**</include>
								</includes>
							</resource>
						</webResources>
					</configuration>
				</plugin>
			</plugins>
		</build>
		<properties>
			<!-- default Spring profiles -->
			<spring.profiles.active>dev${profile.no-liquibase}</spring.profiles.active>
		</properties>
	</profile>
	<profile>
		<id>prod</id>
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-undertow</artifactId>
			</dependency>
		</dependencies>
		<build>
			<plugins>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${maven-clean-plugin.version}</version>
					<configuration>
						<filesets>
							<fileset>
								<directory>target/www/</directory>
							</fileset>
						</filesets>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>${maven-war-plugin.version}</version>
					<configuration>
						<failOnMissingWebXml>false</failOnMissingWebXml>
						<warSourceDirectory>target/www/</warSourceDirectory>
						<webResources>
							<resource>
								<directory>src/main/webapp</directory>
								<includes>
									<include>WEB-INF/**</include>
								</includes>
							</resource>
						</webResources>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring-boot.version}</version>
					<configuration>
						<mainClass>${start-class}</mainClass>
						<executable>true</executable>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>build-info</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>com.github.eirslett</groupId>
					<artifactId>frontend-maven-plugin</artifactId>
					<version>${frontend-maven-plugin.version}</version>
					<executions>
						<execution>
							<id>install node and yarn</id>
							<goals>
								<goal>install-node-and-yarn</goal>
							</goals>
							<configuration>
								<nodeVersion>${node.version}</nodeVersion>
								<yarnVersion>${yarn.version}</yarnVersion>
							</configuration>
						</execution>
						<execution>
							<id>yarn install</id>
							<goals>
								<goal>yarn</goal>
							</goals>
							<configuration>
								<arguments>install --force</arguments>
							</configuration>
						</execution>
						<execution>
							<id>webpack build test</id>
							<goals>
								<goal>yarn</goal>
							</goals>
							<phase>test</phase>
							<configuration>
								<arguments>run webpack:test</arguments>
								<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
							</configuration>
						</execution>
						<execution>
							<id>webpack build prod</id>
							<goals>
								<goal>yarn</goal>
							</goals>
							<phase>generate-resources</phase>
							<configuration>
								<arguments>run webpack:prod</arguments>
								<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>pl.project13.maven</groupId>
					<artifactId>git-commit-id-plugin</artifactId>
					<version>2.2.4</version>
					<executions>
						<execution>
							<goals>
								<goal>revision</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<failOnNoGitDirectory>false</failOnNoGitDirectory>
						<generateGitPropertiesFile>true</generateGitPropertiesFile>
						<includeOnlyProperties>
							<includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
							<includeOnlyProperty>^git.commit.id.describe$</includeOnlyProperty>
							<includeOnlyProperty>^git.branch$</includeOnlyProperty>
						</includeOnlyProperties>
					</configuration>
				</plugin>
			</plugins>
		</build>
		<properties>
			<!-- default Spring profiles -->
			<spring.profiles.active>prod${profile.swagger}${profile.no-liquibase}</spring.profiles.active>
		</properties>
	</profile>
	<profile>
		<!-- Profile for doing "continuous compilation" with the Scala Maven plugin. 
			It allows automatic compilation of Java classes as soon as they are saved. 
			To use it, run in 3 terminals: - './mvnw -Pcc scala:cc' for continuous compilation 
			of your classes - './mvnw -Pcc -Pdev' for hot reload of Spring boot - 'npm 
			start/yarn start' for hot reload of the HTML/JavaScript asset Everything 
			should hot reload automatically! -->
		<id>cc</id>
		<dependencies>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-undertow</artifactId>
			</dependency>
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-devtools</artifactId>
				<optional>true</optional>
			</dependency>
		</dependencies>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>${maven-war-plugin.version}</version>
					<configuration>
						<failOnMissingWebXml>false</failOnMissingWebXml>
						<warSourceDirectory>src/main/webapp/</warSourceDirectory>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring-boot.version}</version>
					<configuration>
						<mainClass>${start-class}</mainClass>
						<executable>true</executable>
						<fork>true</fork>
						<addResources>true</addResources>
						<!-- Enable the line below to have remote debugging of your application 
							on port 5005 <jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments> -->
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin.version}</version>
					<executions>
						<execution>
							<id>default-compile</id>
							<phase>none</phase>
						</execution>
						<execution>
							<id>default-testCompile</id>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>net.alchim31.maven</groupId>
					<artifactId>scala-maven-plugin</artifactId>
					<version>${scala-maven-plugin.version}</version>
					<executions>
						<execution>
							<id>compile</id>
							<phase>compile</phase>
							<goals>
								<goal>add-source</goal>
								<goal>compile</goal>
							</goals>
						</execution>
						<execution>
							<id>test-compile</id>
							<phase>test-compile</phase>
							<goals>
								<goal>add-source</goal>
								<goal>testCompile</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<recompileMode>incremental</recompileMode>
						<verbose>true</verbose>
						<scalaVersion>${scala.version}</scalaVersion>
					</configuration>
				</plugin>
			</plugins>
		</build>
		<properties>
			<!-- default Spring profiles -->
			<spring.profiles.active>dev,swagger</spring.profiles.active>
		</properties>
	</profile>
	<profile>
		<!-- Profile for monitoring the application with Graphite. -->
		<id>graphite</id>
		<dependencies>
			<dependency>
				<groupId>io.dropwizard.metrics</groupId>
				<artifactId>metrics-graphite</artifactId>
			</dependency>
		</dependencies>
	</profile>
	<profile>
		<!-- Profile for monitoring the application with Prometheus. -->
		<id>prometheus</id>
		<dependencies>
			<dependency>
				<groupId>io.prometheus</groupId>
				<artifactId>simpleclient</artifactId>
			</dependency>
			<dependency>
				<groupId>io.prometheus</groupId>
				<artifactId>simpleclient_servlet</artifactId>
			</dependency>
			<dependency>
				<groupId>io.prometheus</groupId>
				<artifactId>simpleclient_dropwizard</artifactId>
			</dependency>
		</dependencies>
	</profile>
	<profile>
		<!-- Profile for tracing requests with Zipkin. -->
		<id>zipkin</id>
		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-starter-zipkin</artifactId>
			</dependency>
		</dependencies>
	</profile>
	<profile>
		<!-- Profile for applying IDE-specific configuration. At the moment it 
			configures MapStruct and Hibernate JPA Metamodel Generator, which you need 
			when working with DTOs and entity filtering. -->
		<id>IDE</id>
		<dependencies>
			<dependency>
				<groupId>org.mapstruct</groupId>
				<artifactId>mapstruct-processor</artifactId>
				<version>${mapstruct.version}</version>
			</dependency>
			<dependency>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-jpamodelgen</artifactId>
			</dependency>
		</dependencies>
	</profile>
	<!-- jhipster-needle-maven-add-profile -->
</profiles>

@William-Michael-Russell

If anyone is having problems, also make sure your java and mvn versions match.

java -version
mvn -version

I kept having issues since my JAVA_HOME wasn't sourced and mvn was incorrect.

@qgicup
Copy link

qgicup commented Oct 16, 2018

I had the same problem. Using Java 10, SpringBoot 2.0.3, Hibernate 5.3.1 .

What worked for me in Gradle, was to add javax.xml.bind to annotationProcessor as well :

`
annotationProcessor group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'

annotationProcessor group: 'org.hibernate', name: 'hibernate-jpamodelgen', version: '5.3.1.Final'

In this way,hibernate-jpamodelgenwon't complain anymore about his missingjavax.xml.bind` dependency, since it's on the same group as him (annotationProcessor)

@pgesek
Copy link

pgesek commented Oct 17, 2018

For anyone struggling with Maven - I was only able to get it compile after I added the javax.xml dependencies as annotationProcessorPaths for the compiler plugin

         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                        <!-- For JPA static metamodel generation -->
                        <path>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-jpamodelgen</artifactId>
                            <version>${hibernate.version}</version>
                        </path>
                        <path>
                            <groupId>javax.xml.bind</groupId>
                            <artifactId>jaxb-api</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                        <path>
                            <groupId>com.sun.xml.bind</groupId>
                            <artifactId>jaxb-core</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                        <path>
                            <groupId>com.sun.xml.bind</groupId>
                            <artifactId>jaxb-impl</artifactId>
                            <version>${jaxb.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

@Totot0
Copy link

Totot0 commented Apr 3, 2019

I used the method shown above that is Java 10 and clonnage of the repo git. But when I create my micro service the package util in rest does not generate. The class pagination and header are not generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment