New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java9 modules, fix overlapping package names #666

Closed
pethers opened this Issue Apr 26, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@pethers
Contributor

pethers commented Apr 26, 2018

Overlapping package names in different jar files, cause issues when using module-info.java in java9.

Workaround https://github.com/Hack23/cia/blob/master/service.data.impl/javers-all/pom.xml to bundle all alls jar into 1, but not nice.

Modular jar:s with Automatic-Module-Name set would be prefered.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Apr 27, 2018

Hi, I have tested javers on java10 but without modulepath. Never tested with modules. Would you like to contribute a PR with modules support to javers? We dont want the single jar. Im not sure if automatic module names are the best solution. maybe we can create regular module names and hide most of the public classes inside modules?

@pethers

This comment has been minimized.

Contributor

pethers commented Apr 27, 2018

Main problem is that https://github.com/javers/javers/tree/master/javers-spring-jpa/src/main/java/org/javers/spring/auditable/aspect/springdata and https://github.com/javers/javers/tree/master/javers-spring/src/main/java/org/javers/spring/auditable/aspect/springdata is using the same package name.

Renaming javers-spring-jpa/src/main/java/org/javers/spring/auditable/aspect/springdata to javers-spring-jpa/src/main/java/org/javers/spring/auditable/aspect/springdatajpa, will solve the package name conflict and should be a minimal change. Happy to create a pull request for this if wanted ?

Example with automatic module name for javers-spring-data, without any change to jar automatic module name is based on the file name. So by default this would be javers.spring.data.

By adding manifest entries in jar plugin, you can set it to anything you want.

<Automatic-Module-Name>org.javers.spring.data</Automatic-Module-Name>

This do not require any changes to jdk compile time version.

Another solution, is to add module-info.java to all modules, but requires multiple jdk toolchain if support for JDK7 -> JDK9 is required. So probably overkill.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Apr 28, 2018

If the packege renaming will do the job, let's do it. Seems like the this class https://github.com/javers/javers/tree/master/javers-spring-jpa/src/main/java/org/javers/spring/auditable/aspect/springdata is not used by users so renaming is safe. Please contribute a PR. Thanks.

pethers added a commit to pethers/javers that referenced this issue Apr 29, 2018

javers#666 refactor package name
org.javers.spring.auditable.aspect.springdata ->
org.javers.spring.auditable.aspect.springdatajpa.

pethers added a commit to pethers/javers that referenced this issue Apr 29, 2018

@pethers

This comment has been minimized.

Contributor

pethers commented Apr 29, 2018

Created #668 , but maybe better option to move JaversSpringDataJpaAuditableRepositoryAspect to javers-spring module. Would not break compatibility and not need package -> protected modifier changes.

pethers added a commit to pethers/javers that referenced this issue Apr 29, 2018

bartoszwalacik added a commit that referenced this issue Apr 30, 2018

Merge pull request #668 from pethers/master
#666 refactor package name
@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented May 1, 2018

released in 3.7.4

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