Code Monkey home page Code Monkey logo

eclipselink-maven-plugin's Introduction

eclipselink-maven-plugin

Maven Central Hex.pm Codacy Badge

Eclipselink JPA maven plugin made to simplify life of the Eclipselink JPA developer.

Features

  • No need to setup special APT processor for canonical model generation, just use goal modelgen.
  • Allows you to get rid of the persistence.xml file as the classes are detected automatically and a persistence.xml file is generated.
  • If the persistence.xml file already exists, missing <class>...</class> entries are added automatically. This allows you to have a basic configuration, but you do not have to manually add class entries.

Versions

  • 3.x releases uses the jakarta.* packages
  • 2.x releases uses the javax.* packages

Usage

Static weaving:

<plugin>
	<groupId>com.ethlo.persistence.tools</groupId>
	<artifactId>eclipselink-maven-plugin</artifactId>
	<version>${eclipselink-maven-plugin.version}</version>
	<executions>
		<execution>
			<phase>process-classes</phase>
			<goals>
				<goal>weave</goal>
			</goals>
		</execution>
	</executions>
</plugin>

Meta-model generation:

<plugin>
	<groupId>com.ethlo.persistence.tools</groupId>
	<artifactId>eclipselink-maven-plugin</artifactId>
	<version>${eclipselink-maven-plugin.version}</version>
	<executions>
		<execution>
			<phase>generate-sources</phase>
			<goals>
				<goal>modelgen</goal>
			</goals>
		</execution>
	</executions>
</plugin>

Both weave, DDL and meta-model generation and setting basePackages:

<plugin>
	<groupId>com.ethlo.persistence.tools</groupId>
	<artifactId>eclipselink-maven-plugin</artifactId>
	<version>${eclipselink-maven-plugin.version}</version>
	<executions>
		<execution>
			<id>weave</id>
			<phase>process-classes</phase>
			<goals>
				<goal>weave</goal>
			</goals>
		</execution>
		<execution>
			<id>ddl</id>
			<phase>process-classes</phase>
			<goals>
				<goal>ddl</goal>
			</goals>
			<configuration>
				<databaseProductName>mysql</databaseProductName>
			</configuration>
		</execution>
		<execution>
			<id>modelgen</id>
			<phase>generate-sources</phase>
			<goals>
				<goal>modelgen</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<basePackages>
			<basePackage>org.my.projectA</basePackage>
			<basePackage>org.my.projectB</basePackage>
		</basePackages>
	</configuration>
</plugin>

eclipselink-maven-plugin's People

Contributors

ethlo avatar jansohn avatar knesch avatar ljnelson avatar mortenharaldsen avatar qwasli avatar timomeinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eclipselink-maven-plugin's Issues

NullPointerException in Classgraph while weaving Java 11 project

I'm using plugin version 2.7.5.1 and recently upgraded my project to Java 11. While I was on my way I encountered following issue during the build:

Failed to execute goal com.ethlo.persistence.tools:eclipselink-maven-plugin:2.7.5.1:weave
    ...
Caused by: org.apache.maven.plugin.MojoExecutionException: Uncaught exception during scan
    at com.ethlo.persistence.tools.eclipselink.EclipselinkStaticWeaveMojo.execute (EclipselinkStaticWeaveMojo.java:117)
    ...
Caused by: java.lang.NullPointerException
    at io.github.classgraph.ObjectTypedValueWrapper.getArrayValueClassOrName (ObjectTypedValueWrapper.java:290)

Root cause seems to be an issue in the underlying Classgraph version 4.8.21 (cf. classgraph/classgraph#370). Bumping plugin dependency version of Classgraph manually to at least 4.8.48 fixed the issue for me

Static-Weaving failing due to erroneous generated persistence.xml

I just tried static-weaving with new eclipselink-maven-plugin v2.7.4.
Weaving fails since the generated persistence.xml is erroneous. The class-entries don't have the full qualified name, but the class definition.

Generated persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
    xmlns="http://xmlns.jcp.org/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
    <persistence-unit name="regid-core" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <properties>
            <property name="eclipselink.weaving" value="static"/>
        </properties>
        <class>public abstract class com.foo.domain.entities.BaseVersionEntity&lt;I&gt; extends com.foo.domain.entities.BaseEntity&lt;I&gt;</class>
        <class>...</class>
    </persistence-unit>
</persistence>

My setup:

  • Windows 10
  • Java 8/11
  • Maven 3.5.3

Breaks after Spring Boot 3.1 migration

This plugin was working for Spring Boot 3.0, but after migrating to Spring Boot 3.1 I’m getting the error:
Cannot invoke “java.util.List.size()” because genericTypes is null
I dug into the plugin dependencies and noticed that some versions are now behind the required Spring Framework version 6.0.9, as well as others that seem outdated. Manually upgrading these dependencies did not help.

Shouldn't version of javax.persistence be 2.1.0?

Eclipselink 2.5.0 depends on javax.persistence 2.1.0. Currently the plugin uses javax.persistence 2.0.0.

I'm not sure, because I don't know what exactly the plugin does internally. But this looks odd to me.

Eclipse error 'You need to run build with JDK or have tools.jar on the classpath'

Hi,

I'm trying to use plugin with Eclipse (2019-12) and AdoptOpenJDK (jdk-11.0.5.10-hotspot) and following error is shown on 'execution' when viewing pom.xml:

"You need to run build with JDK or have tools.jar on the classpath (com.ethlo.persistence.tools:eclipselink-maven-plugin:2.7.5.1:modelgen:default:generate-sources)"

<plugin>
        <groupId>com.ethlo.persistence.tools</groupId>
        <artifactId>eclipselink-maven-plugin</artifactId>
        <version>2.7.5.1/version>
          <executions>
            <execution>
              <phase>generate-sources</phase>
              <goals>
                <goal>modelgen</goal>
              </goals>
            </execution>
          </executions>
      </plugin>

Can you please see if there is anything I can do?

Entities not found for weaving with eclipselink 2.7.10 and spring-boot 2.6.4

Versions:

  • eclipselink = 2.7.10
  • eclipselink-maven-plugin = 2.7.9.1
  • spring-boot = 2.6.4

The weave goal only identifies two abstract entity classes with @MappedSuperClass but does not find the sub-classes that extend them. Base classes...

@MappedSuperclass
public abstract class AbstractEntity<T> {

and

@MappedSuperclass
public abstract class AuditableEntity<T> extends AbstractEntity<T>

and concrete entity:

@Entity
@Table(name = "person")
class Person extends AuditableEntity<String>

Plugin config:

<plugin>
                    <groupId>com.ethlo.persistence.tools</groupId>
                    <artifactId>eclipselink-maven-plugin</artifactId>
                    <version>${maven.eclipselink.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>weave</goal>
                            </goals>
                            <configuration>
                                <logLevel>ALL</logLevel>
                                <basePackage>com.bbende.project.starter</basePackage>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.eclipse.persistence</groupId>
                            <artifactId>org.eclipse.persistence.jpa</artifactId>
                            <version>${eclipse.link.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

Output:

[INFO] Entities found : 2
[DEBUG] Updating persistence.xml file

And persistence.xml ends up with only AbstractEntity and AuditableEntity.

I tried removing the base entities and then it found no entities.

I suspect there may be some class path issue related to all of the various javax vs jakarta changes. The relevant classpath of the project looks like:

89 [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.6.4:compile
 90 [INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.6.4:compile
 91 [INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.7:compile
 92 [INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.6.4:compile
 93 [INFO] |  |  +- com.zaxxer:HikariCP:jar:4.0.3:compile
 94 [INFO] |  |  \- org.springframework:spring-jdbc:jar:5.3.16:compile
 95 [INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
 96 [INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
 97 [INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.6.2:compile
 98 [INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.6.2:compile
 99 [INFO] |  |  +- org.springframework:spring-orm:jar:5.3.16:compile
100 [INFO] |  |  \- org.springframework:spring-tx:jar:5.3.16:compile
101 [INFO] |  \- org.springframework:spring-aspects:jar:5.3.16:compile
102 [INFO] +- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.7.10:compile
103 [INFO] |  +- org.eclipse.persistence:jakarta.persistence:jar:2.2.3:compile
104 [INFO] |  +- org.eclipse.persistence:org.eclipse.persistence.asm:jar:9.2.0:compile
105 [INFO] |  +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.7.10:compile
106 [INFO] |  +- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.7.10:compile
107 [INFO] |  \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.7.10:compile

I thought part of the issue could be that the API classes like @Entity are in two different artifacts:

  • org.eclipse.persistence:jakarta.persistence:jar:2.2.3:compile
  • jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile

So I tried excluding org.eclipse.persistence:jakarta.persistence, but couldn't get any different behavior.

FastClasspathScanner is outdated -- consider porting to ClassGraph

Your project, ethlo/eclipselink-maven-plugin, depends on the outdated library FastClasspathScanner in the following source files:

FastClasspathScanner has been significantly reworked since the version your code depends upon:

  • a significant number of bugs have been fixed
  • some nontrivial API changes have been made to simplify and unify the API
  • FastClasspathScanner has been renamed to ClassGraph: https://github.com/classgraph/classgraph

ClassGraph is a significantly more robust library than FastClasspathScanner, and is more future-proof. All future development work will be focused on ClassGraph, and FastClasspathScanner will see no future development.

Please consider porting your code over to the new ClassGraph API, particularly if your project is in production or has downstream dependencies:

Feel free to close this bug report if this code is no longer in use. (You were sent this bug report because your project depends upon FastClasspathScanner, and has been starred by 17 users. Apologies if this bug report is not helpful.)

Build fails if adding entities to persistence.xml with JCP namespace

Reproduce

Run plugin on a project with

  1. An entity missing from persistence.xml
  2. The new JCP namespace http://xmlns.jcp.org/xml/ns/persistence in persistence.xml. See http://antoniogoncalves.org/2013/06/04/java-ee-7-deployment-descriptors/

Result

Build fails.
Caused by: java.lang.NullPointerException
at com.ethlo.persistence.tools.eclipselink.PersistenceXmlHelper.appendClasses(PersistenceXmlHelper.java:67)
at com.ethlo.persistence.tools.eclipselink.EclipselinkStaticWeaveMojo.processWeaving(EclipselinkStaticWeave Mojo.java:110)
at com.ethlo.persistence.tools.eclipselink.EclipselinkStaticWeaveMojo.execute(EclipselinkStaticWeaveMojo.ja va:76)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more

PersistenceXmlHelper only checks the old namespace http://java.sun.com/xml/ns/persistence and fails if it is not present.

Upgrade to EclipseLink 2.7.0

Version 2.7.0 of EclipseLink has been released:
https://www.eclipse.org/eclipselink/releases/2.7.php

Due to the update of javax.persistence to 2.2.0 we get errors with the current version of the plugin:

java.lang.SecurityException: class "javax.persistence.LockModeType"'s signer information does not match signer information of other classes in the same package

As javax.persistence is a transitive dependency of EclipseLink, it might be removed from the pom.xml.

Check for changes before re-generating models

I really enjoy using the meta-model generation plugin for my build pipeline but I keep running into this issue. Sometimes Maven is ran more than once without the source code changing. In these scenarios, the Maven compiler plugin would normally detect that there were no changes and skip re-compiling the project. But with this plugin added, the meta models are re-generated which triggers a re-compile. The artifact is correct but it would be really nice if this plugin was able to "detect changes" in the source before re-generating much like the Maven compiler plugin.

Is there any interest to add this feature? If so, I can research more and begin working on a PR. I'm just looking for feedback before spending any more time on it.

JDK 21: java.lang.IllegalArgumentException: Unsupported class file major version 65

When I use the goal "weave" with plugin v3.0.0 with JDK 21 I get the following error:

[EL Finest]: weaver: 2023-12-18 12:21:25.616--Thread(Thread[#1,main,5,main])--java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.eclipse.persistence.internal.libraries.asm.ClassReader.<init>(ClassReader.java:199)
        at org.eclipse.persistence.internal.libraries.asm.ClassReader.<init>(ClassReader.java:180)
        at org.eclipse.persistence.asm.internal.platform.eclipselink.ClassReaderImpl.<init>(ClassReaderImpl.java:48)
        at org.eclipse.persistence.asm.ASMFactory.createClassReader(ASMFactory.java:139)
        at org.eclipse.persistence.asm.EclipseLinkClassReader.<init>(EclipseLinkClassReader.java:34)
        at org.eclipse.persistence.asm.EclipseLinkClassReader.<init>(EclipseLinkClassReader.java:30)
        at org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver.transform(PersistenceWeaver.java:128)
        at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTransformer.transform(StaticWeaveClassTransformer.java:88)
        at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor.process(StaticWeaveProcessor.java:312)

I think an upgrade to EclipseLink 4.0.2 in the dependencies of the plugin is necessary.
When I manually override the dependency, then the error is gone.

<plugin>
<groupId>com.ethlo.persistence.tools</groupId>
<artifactId>eclipselink-maven-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
	<dependency>
		<groupId>org.eclipse.persistence</groupId>
		<artifactId>org.eclipse.persistence.jpa</artifactId>
		<version>4.0.2</version>
		<exclusions>
			<exclusion>
				<artifactId>javax.persistence</artifactId>
				<groupId>org.eclipse.persistence</groupId>
			</exclusion>
		</exclusions>
	</dependency>
</dependencies>
</plugin>

Static weaving plugin-dependencies for Java 11

Static weaving during build only works with Java 11, when I add an extra dependeny to the eclipselink-maven-plugin plugin.

<pluginManagement>
  <plugins>
	<plugin>
	  <groupId>com.ethlo.persistence.tools</groupId>
	  <artifactId>eclipselink-maven-plugin</artifactId>
	  <version>2.7.4.1</version>
	  <dependencies>
		<dependency>
		  <groupId>org.glassfish.jaxb</groupId>
		  <artifactId>jaxb-runtime</artifactId>
		  <version>2.3.2</version>
		</dependency>
	  </dependencies>
	</plugin>
        ...

Since this dependency (which I'm not sure is the correct one, since its a complete bundle of libs) is only needed during build it should be used by the plugin itself (for Java 11).

generated persistence.xml has wrong structure

if you have some elements in your existing persistence.xml (but not all of them), the missing elements will be added/generated by the plugin. But they will be placed behind the element instead of in front of it, and apparently thats not allowed by the XSD and will produce a SAX parser exception when you try to deploy the application, e.g. on Payara.

example of generated persistence.xml. see how some of the class elements are in front of the properties element and some are behind? the ones in front where part of the original persistence.xml, the one behind was missing and was added by the plugin:

    <persistence-unit name="mysql" transaction-type="JTA">
        <description>TestProject Datamodel</description>
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>TestProjectDatasource</jta-data-source>
        <class>de.otto.cccs.testproject.entities.Semaphore</class>
        <class>de.otto.cccs.testproject.entities.Task</class>
        <class>de.otto.cccs.testproject.entities.EntityBase</class>
        <properties>
            <property name="eclipselink.ddlgen-terminate-statements" value="true"/>
            <property name="eclipselink.logging.level" value="ALL"/>
            <property name="eclipselink.logging.parameters" value="true"/>
            <property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
            <property name="eclipselink.weaving" value="static"/>
            <property name="javax.persistence.sharedCache.mode" value="ALL"/>
            <property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
            <property name="eclipselink.target-database" value="MySQL"/>
            <property name="eclipselink.application-location" value="C:\temp"/>
        </properties>
        <class>de.otto.cccs.testproject.entities.MyEntity</class>
    </persistence-unit>

see exception below:

[2018-09-07T12:23:34.237+0000] [Payara 5.183-SNAPSHOT] [SCHWERWIEGEND] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=128 _ThreadName=admin-thread-pool::admin-listener(2)] [timeMillis: 1536323014237] [levelValue: 1000] [[
  Exception during lifecycle processing
java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 16; Deployment descriptor file META-INF/persistence.xml in archive [classes].  cvc-complex-type.2.4.d: Ungültiger Content wurde beginnend mit Element 'class' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
        at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:207)
        at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:223)
        at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:91)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:933)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:873)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:383)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:540)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:549)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:545)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:544)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:575)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:567)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:566)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1475)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1857)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1733)
        at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:409)
        at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:236)
        at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:704)
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:377)
        at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:179)
        at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:182)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:516)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:213)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
        at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:208)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
        at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:208)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 16; Deployment descriptor file META-INF/persistence.xml in archive [classes].  cvc-complex-type.2.4.d: Ungültiger Content wurde beginnend mit Element 'class' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
        at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:331)
        at com.sun.enterprise.deployment.archivist.ExtensionsArchivist.open(ExtensionsArchivist.java:179)
        at com.sun.enterprise.deployment.archivist.PersistenceArchivist.readPersistenceDeploymentDescriptor(PersistenceArchivist.java:158)
        at com.sun.enterprise.deployment.archivist.WarPersistenceArchivist.open(WarPersistenceArchivist.java:99)
        at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:403)
        at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:394)
        at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:269)
        at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:278)
        at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:239)
        at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
        at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:199)
        ... 78 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 16; cvc-complex-type.2.4.d: Ungültiger Content wurde beginnend mit Element 'class' gefunden. An dieser Stelle wird kein untergeordnetes Element erwartet.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1795)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
        at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:321)
        ... 88 more
]]

Support for Java 10

Plugin fails with error when using Java 10. Also could you please add support for jpa 2.2?

screen shot 2018-07-05 at 3 46 09 pm

Release plugin as non SNAPSHOT

Hello,
please is it possible to release plugin as non SNAPSHOT?
It's not possible to use maven release plugin while we have SNAPSHOT dependencies.

Thanks

Builds failing

Since:
150b57a
3b0aed7...150b57a

See also:
https://travis-ci.org/ethlo/eclipselink-maven-plugin/builds/141322116

Root Cause:
Failure to find org.scannotation:scannotation:jar:1.0.4 (Does not exist https://mvnrepository.com/artifact/org.scannotation/scannotation)

[ERROR] Failed to execute goal on project eclipselink-maven-plugin: Could not resolve dependencies for project com.ethlo.persistence.tools:eclipselink-maven-plugin:maven-plugin:2.6.3-SNAPSHOT: Failure to find org.scannotation:scannotation:jar:1.0.4 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

Can't re-build project without Maven "clean" phase

How to reproduce

  1. run mvn clean package
  2. run mvn package

Expected behaviour
The second command succeeds

Actual behaviour
The command execution fails with error message

[ERROR] Failed to execute goal com.ethlo.persistence.tools:eclipselink-maven-plugin:3.0.2:modelgen (modelgen) on project security: Processing failed: 
[ERROR] Note: Hibernate JPA 2 Static-Metamodel Generator 6.2.0.CR4
[ERROR] warning: Unable to parse persistence.xml: Unable to perform unmarshalling at line number 0 and column 0. Message: null
[ERROR] error: Problem with Filer: Attempt to recreate a file for type com.my.Entity_

Workaround
Include the clean phase each time you build the project

Java 16 support

Build my project with EclipseLink 2.7.8 in my Helidon project, and got the following errors.

https://github.com/hantsy/helidon-sandbox/tree/master/mp-jpa

[INFO] --- eclipselink-maven-plugin:2.7.5.1:weave (weave) @ mp-jpa ---
[INFO] Entities found : 3
[INFO] Source classes dir: D:\hantsylabs\helidon-sample\mp-jpa\target\classes
[INFO] Target classes dir: D:\hantsylabs\helidon-sample\mp-jpa\target\classes
[EL Severe]: metadata: 2021-05-13 11:18:39.525--ServerSession(1412165323)--The com.example.Post class was compiled with an unsupported JDK. Report this error to the EclipseLink open so
urce project.
java.lang.IllegalArgumentException: Unsupported class file major version 60
[EL Severe]: metadata: 2021-05-13 11:18:39.549--ServerSession(1412165323)--The com.example.Post class was compiled with an unsupported JDK. Report this error to the EclipseLink open so
urce project.
java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 0
[EL Severe]: metadata: 2021-05-13 11:18:39.557--ServerSession(1412165323)--The com.example.PostId class was compiled with an unsupported JDK. Report this error to the EclipseLink open
source project.
java.lang.IllegalArgumentException: Unsupported class file major version 60
[EL Severe]: metadata: 2021-05-13 11:18:39.557--ServerSession(1412165323)--The com.example.PostId class was compiled with an unsupported JDK. Report this error to the EclipseLink open
source project.
java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 0
[EL Severe]: metadata: 2021-05-13 11:18:39.557--ServerSession(1412165323)--The com.example.Comment class was compiled with an unsupported JDK. Report this error to the EclipseLink open
 source project.
java.lang.IllegalArgumentException: Unsupported class file major version 60
[EL Severe]: metadata: 2021-05-13 11:18:39.557--ServerSession(1412165323)--The com.example.Comment class was compiled with an unsupported JDK. Report this error to the EclipseLink open
 source project.
java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 0
[INFO] Eclipselink weaving completed

No support for "project.build.sourceEncoding"

We have a project using "UTF-8"-encoding. On the other side, we have a company-wide Jenkins-Ci-Server, that is installed on Windows-OS with cp1252-Encoding. When using the plugin, the compile inside the weaving fails, because of encoding-issues. The plugin should use the property "project.build.sourceEncoding" for the compilation of the sources.

EclipselinkStaticWeaveMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Hi, build my project with EclipseLink 3.0.0 in my OpenJFX project, and got the following errors.

[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ nota-corretagem-fx ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 43 source files to /home/gilberto.andrade/tmp/GILBERTOCA/nota-corretagem-fx/target/classes
[INFO] /home/gilberto.andrade/tmp/GILBERTOCA/nota-corretagem-fx/src/main/java/com/gilbertoca/corretagem/controller/AtivoController.java: Some input files use unchecked or unsafe operations.
[INFO] /home/gilberto.andrade/tmp/GILBERTOCA/nota-corretagem-fx/src/main/java/com/gilbertoca/corretagem/controller/AtivoController.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- eclipselink-maven-plugin:3.0.0:weave (default) @ nota-corretagem-fx ---
[WARNING] Error injecting: com.ethlo.persistence.tools.eclipselink.EclipselinkStaticWeaveMojo
java.lang.TypeNotPresentException: Type com.ethlo.persistence.tools.eclipselink.EclipselinkStaticWeaveMojo not present
    at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:147)
    at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:85)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:66)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:112)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:127)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:61)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:520)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:124)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.UnsupportedClassVersionError: com/ethlo/persistence/tools/eclipselink/EclipselinkStaticWeaveMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:1017)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:174)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:550)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:458)

That's because I'm using jdk 11.

Thank you for the project!
Much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.