1

感谢 pupeno 在 spring 和 moditect 上的先例工作,帮助我解决了我在这个主题上的大部分问题,但是我被他挡得更远了。

我的问题是非法访问异常

我的 poc 在github上可用

我曾经添加这段代码以使其与 intelliJ IDEA 一起使用:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
        <compilerArgs>
            <arg>--add-opens java.base/java.lang=ALL-UNAMED</arg>
        </compilerArgs>
        <source>11</source>
        <target>11</target>
    </configuration>
</plugin>

但是知道 jlink 我不知道如何重现相同的曲目

这是我的完整堆栈跟踪:

Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: Cannot load configuration class: install.bll.springConf.BeanConfiguration
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:413)
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:253)
    at spring.context@5.1.3.RELEASE/org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286)
    at spring.context@5.1.3.RELEASE/org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:130)
    at spring.context@5.1.3.RELEASE/org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
    at spring.context@5.1.3.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:88)
    at install/install.bll.springConf.InstallDB.create(InstallDB.java:33)
    at install/install.bll.Install.setup(Install.java:35)
    at install/install.ui.Toolbox.ActionTB$1.handle(ActionTB.java:37)
    at install/install.ui.Toolbox.ActionTB$1.handle(ActionTB.java:31)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8879)
    at javafx.controls/javafx.scene.control.Button.fire(Button.java:200)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.keyReleased(ButtonBehavior.java:161)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Scene$KeyHandler.process(Scene.java:4058)
    at javafx.graphics/javafx.scene.Scene$KeyHandler.access$1500(Scene.java:4004)
    at javafx.graphics/javafx.scene.Scene.processKeyEvent(Scene.java:2121)
    at javafx.graphics/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2595)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:217)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:149)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:248)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:390)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:247)
    at javafx.graphics/com.sun.glass.ui.View.handleKeyEvent(View.java:547)
    at javafx.graphics/com.sun.glass.ui.View.notifyKey(View.java:971)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessException-->module spring.core does not read module install
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:503)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:359)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:582)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:106)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:104)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:130)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:315)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:569)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:416)
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:137)
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109)
    at spring.context@5.1.3.RELEASE/org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:402)
    ... 56 more
Caused by: java.lang.IllegalAccessException: module spring.core does not read module install
    at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:197)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at spring.core@5.1.3.RELEASE/org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:497)
    ... 71 more

我真的不知道我能做什么,因为我的模块安装是打开的并且需要(显然)需要的东西

open module install {

requires java.base;
requires javafx.graphics;
requires javafx.controls;
requires javafx.base;
requires javafx.swing;
requires spring.orm;
//requires spring.jdbc;
//requires spring.jcl;
//requires spring.expression;
requires spring.data.commons;
requires spring.beans;
//requires spring.aop;
requires spring.data.jpa;
requires spring.tx;
//requires spring.core;
requires slf4j.api;
requires spring.context;
requires org.apache.logging.log4j.core;
requires org.apache.logging.log4j;
requires h2;
requires hibernate.entitymanager;
requires org.hibernate.orm.core;
//requires org.hibernate.commons.annotations;
//requires jmx;
requires jdk.jconsole;
requires commons.dbcp2;
requires java.persistence;
requires commons.beanutils;
requires java.sql;
requires java.desktop;
//requires java.transaction;

requires jdk.unsupported;

exports install;
exports install.bll.springConf;
//opens install to spring.core;
//opens install.bll to spring.core;
//opens install.bll.springConf to spring.core;
//opens install.dao to spring.beans, spring.data.jpa, spring.core, spring.context;
//opens install.bo to spring.beans, org.hibernate.commons.annotations, spring.context;
//opens install.service to spring.beans, spring.core, spring.context;
}

我的 moditect 模块结构看起来像

<modules>
<module>
   <artifact>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
   </artifact>
   <moduleInfoSource>
      module java.annotation {
      exports javax.annotation;
      exports javax.annotation.security;
      }
   </moduleInfoSource>
</module> <!-- java.annotation -->
<module>
   <artifact>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
   </artifact>
   <moduleInfoSource>
       module javassist {
       }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>javax.persistence</groupId>
      <artifactId>javax.persistence-api</artifactId>
   </artifact>
   <moduleInfoSource>
      module java.persistence {
      exports javax.persistence;
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>com.fasterxml</groupId>
      <artifactId>classmate</artifactId>
   </artifact>
   <moduleInfoSource>
      module com.fasterxml.classmate {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.jboss</groupId>
      <artifactId>jandex</artifactId>
   </artifact>
   <moduleInfoSource>
      module jandex {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
   </artifact>
   <moduleInfoSource>
      module jboss.logging {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.dom4j</groupId>
      <artifactId>dom4j</artifactId>
   </artifact>
   <moduleInfoSource>
      module dom4j {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-dbcp2</artifactId>
   </artifact>
   <moduleInfoSource>
      module commons.dbcp2 {
      requires java.management;
      requires java.sql;
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.jboss.spec.javax.transaction</groupId>
      <artifactId>jboss-transaction-api_1.2_spec</artifactId>
   </artifact>
   <moduleInfoSource>
      module org.jboss.spec.javax.transaction {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
   </artifact>
   <moduleInfoSource>
      module commons.beanutils {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
   </artifact>
   <moduleInfoSource>
      module slf4j.api {
      opens org.slf4j to spring.data.commons;
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>javax.activation</groupId>
      <artifactId>javax.activation-api</artifactId>
   </artifact>
   <moduleInfoSource>
       module javax.activation {
       }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
   </artifact>
   <moduleInfoSource>
      module commons.pool {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
   </artifact>
   <moduleInfoSource>
      module bytebuddy {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>antlr</groupId>
      <artifactId>antlr</artifactId>
   </artifact>
   <moduleInfoSource>
      module antlr {
       }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
   </artifact>
   <moduleInfoSource>
      module commons.collections {
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
   </artifact>
   <moduleInfoSource>
      module h2 {
      requires java.sql;
      exports org.h2;
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
   </artifact>
   <moduleInfoSource>
      module org.apache.logging.log4j.core {
      requires org.apache.logging.log4j;
      exports org.apache.logging.log4j.core;
      }
   </moduleInfoSource>
</module>
<module>
   <artifact>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
   </artifact>
   <moduleInfoSource>
      module com.fasterxml.jackson.core {
      exports com.fasterxml.jackson.core;
      exports com.fasterxml.jackson.core.type;
      }
   </moduleInfoSource>
</module> <!-- com.fasterxml.jackson.core -->
<module>
   <artifact>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
   </artifact>
   <moduleInfoSource>
      module com.fasterxml.jackson.databind {
      requires com.fasterxml.jackson.core;
      exports com.fasterxml.jackson.databind.module;
      exports com.fasterxml.jackson.databind;
      }
   </moduleInfoSource>
</module> <!-- com.fasterxml.jackson.databind -->
<module>
   <artifact>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
   </artifact>
   <moduleInfoSource>
      module com.fasterxml.jackson.annotations {
      }
   </moduleInfoSource>
</module> <!-- com.fasterxml.jackson.annotations -->
<module>
   <artifact>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
   </artifact>
   <moduleInfoSource>
      module org.hibernate.orm.core {
      }
   </moduleInfoSource>
</module> <!-- hibernate.core -->
<module>
   <artifact>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-entitymanager</artifactId>
   </artifact>
   <moduleInfoSource>
      module hibernate.entitymanager {
      }
   </moduleInfoSource>
</module> <!-- hibernate.entitymanager -->
<module>
   <artifact>
      <groupId>org.hibernate.common</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
   </artifact>
   <moduleInfoSource>
      module org.hibernate.commons.annotations {
      }
   </moduleInfoSource>
</module> <!-- hibernate.entitymanager -->
<module>
   <artifact>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
   </artifact>
   <moduleInfoSource>
      module java.validation {
      }
   </moduleInfoSource>
</module> <!-- java.validation -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jcl</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.jcl {
      requires org.apache.logging.log4j;
      exports org.apache.commons.logging;
      }
   </moduleInfoSource>
</module> <!-- spring.jcl -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.core {
      exports org.springframework.cglib.reflect;
      exports org.springframework.util.comparator;
      exports org.springframework.asm;
      exports org.springframework.cglib.core;
      exports org.springframework.cglib.proxy;
      exports org.springframework.cglib.transform;
      exports org.springframework.core;
      exports org.springframework.core.annotation;
      exports org.springframework.core.convert;
      exports org.springframework.core.convert.converter;
      exports org.springframework.core.convert.support;
      exports org.springframework.core.env;
      exports org.springframework.core.io;
      exports org.springframework.core.io.support;
      exports org.springframework.core.type;
      exports org.springframework.core.type.filter;
      exports org.springframework.core.type.classreading;
      exports org.springframework.objenesis;
      exports org.springframework.util;
      exports org.springframework.util.xml;
      requires aspectjrt;
      requires javassist;
      requires jdk.jconsole;
      requires java.desktop;
      requires java.management;
      requires java.xml;
      requires spring.jcl;
      //requires certytech.certyprint.install;
      }
   </moduleInfoSource>
</module> <!-- spring.core -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
   </artifact>
   <moduleInfoSource>
      open module spring.beans {
      exports org.springframework.beans.factory.wiring;
      exports org.springframework.beans;
      exports org.springframework.beans.factory;
      exports org.springframework.beans.factory.annotation;
      exports org.springframework.beans.factory.config;
      exports org.springframework.beans.factory.support;
      exports org.springframework.beans.factory.parsing;
      exports org.springframework.beans.factory.xml;
      exports org.springframework.beans.propertyeditors;
      exports org.springframework.beans.support;
      requires java.management.rmi;
      requires java.desktop;
      requires spring.core;
      requires spring.jcl;
      }
   </moduleInfoSource>
</module> <!-- spring.beans -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.aop {
      exports org.springframework.aop.config;
      exports org.springframework.aop.framework;
      exports org.springframework.aop.framework.autoproxy;
      exports org.springframework.aop.support;
      exports org.springframework.aop.aspectj.annotation;
      opens org.aopalliance.intercept to spring.tx;
      requires spring.beans;
      requires spring.core;
      requires spring.jcl;
      requires aspectjrt;
      exports org.springframework.aop.scope;
      }
   </moduleInfoSource>
</module> <!-- spring.aop -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.expression {
      exports org.springframework.expression;
      exports org.springframework.expression.spel;
      exports org.springframework.expression.spel.standard;
      exports org.springframework.expression.spel.support;
      requires spring.core;
      }
   </moduleInfoSource>
</module> <!-- spring.expression -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.context {
      opens org.springframework.context.support to spring.core;
      //requires java.xml.ws.annotation;
      requires java.naming;
      exports org.springframework.validation.annotation;
      exports org.springframework.ui.context.support;
      exports org.springframework.validation;
      exports org.springframework.jndi;
      exports org.springframework.context.annotation;
      exports org.springframework.context.event;
      exports org.springframework.context.support;
      exports org.springframework.context;
      exports org.springframework.format.support;
      exports org.springframework.format;
      exports org.springframework.jmx.export.naming;
      exports org.springframework.stereotype;
      exports org.springframework.ui.context;
      opens org.springframework.context.annotation to spring.core, spring.beans, certytech.certyprint.install;
      opens org.springframework.instrument.classloading to spring.data.jpa;
      requires java.desktop;
      requires spring.aop;
      requires spring.beans;
      requires spring.core;
      requires spring.expression;
      requires spring.jcl;
      requires java.annotation;
      }
   </moduleInfoSource>
</module> <!-- spring.context -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.tx {
      exports org.springframework.dao.support;
      exports org.springframework.transaction.annotation;
      opens org.springframework.transaction.support to spring.orm;
      requires spring.context;
      requires spring.core;
      requires spring.aop;
      requires spring.beans;
      }
   </moduleInfoSource>
</module> <!-- spring.tx -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.jdbc {
      exports org.springframework.jdbc.datasource.embedded;
      }
   </moduleInfoSource>
</module> <!-- spring.jdbc -->
<module>
   <artifact>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.orm {
      exports org.springframework.orm.jpa;
      exports org.springframework.orm.jpa.support;
      opens org.springframework.orm.jpa;
      requires spring.beans;
      requires spring.core;
      requires spring.tx;
      requires java.persistence;
      }
   </moduleInfoSource>
</module> <!-- spring.orm -->
<module>
   <artifact>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
   </artifact>
   <moduleInfoSource>
      module aspectjrt {
      exports org.aspectj.lang.annotation;
      exports org.aspectj.lang;
      }
   </moduleInfoSource>
</module> <!-- aspectjrt -->
<module>
   <artifact>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
   </artifact>
   <moduleInfoSource>
      module aspectjweaver {
      exports org.aspectj.lang.annotation;
      exports org.aspectj.lang;
      }
   </moduleInfoSource>
</module> <!-- aspectjweaver -->
<module>
   <artifact>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-commons</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.data.commons {
      exports org.springframework.data.auditing.config;
      exports org.springframework.data.config;
      exports org.springframework.data.mapping.context;
      exports org.springframework.data.mapping;
      opens org.springframework.data.repository.core.support to spring.data.jpa;
      opens org.springframework.data.repository.config to spring.data.jpa;
      requires slf4j.api;
      requires spring.beans;
      requires spring.context;
      requires spring.core;
      }
   </moduleInfoSource>
</module> <!-- spring.data.commons -->
<module>
   <artifact>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-jpa</artifactId>
   </artifact>
   <moduleInfoSource>
      module spring.data.jpa {
      exports org.springframework.data.jpa.domain.support;
      opens org.springframework.data.jpa.repository.config to spring.core;
      requires spring.beans;
      requires spring.context;
      requires spring.core;
      requires spring.data.commons;
      requires spring.orm;
      requires java.persistence;
      requires java.management.rmi;
      }
   </moduleInfoSource>
</module> <!-- spring.data.jpa -->
</modules>

我使用了 spring 5.1.3 和 spring data 2.1.3 和 hibernate 5.3.7

这是在不打开所有安装包的情况下做我想做的事情的一种方式吗?它似乎与新的模块安全系统相矛盾。

4

0 回答 0