我正在将我的项目从Java 8迁移到Java 9.我的项目是mavenised.现在,为了迁移到Java 9,我计划创建一个单独的模块目录,其中模块的所有必需依赖项都将用于此目录.
为了通过maven这样做,我知道的唯一方法是使用maven的复制插件来复制模块目录中所有必需的依赖项.因此,在为模块运行maven安装后,依赖的jar将被复制到repository文件夹(默认情况下),并且还会复制到此模块目录文件夹中.
因此,将会有一个jar副本以及pom.xml中的硬编码,用于复制模块目录中的特定依赖项.
这种方法似乎并不干净,是否有任何出路是自动maven可以读取我的module-info.java文件并复制所需的依赖项不在类路径中但在指定的目录中
这是我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.aa.bb</groupId>
<artifactId>cc</artifactId>
<version>0.0.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>dd</artifactId>
<name>dd</name>
<groupId>com.aa.cc</groupId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>10</maven.compiler.source>
<maven.compiler.target>10</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
<compilerArgs>
<arg>--module-path</arg>
<arg>./moduledir</arg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
module-info.java
module com.some_module_name {
requires …Run Code Online (Sandbox Code Playgroud) RPC协议TCP用作底层协议并HTTP再次TCP用作底层协议。那么为什么 HTTP 被广泛接受呢?
为什么SOAP使用HTTP作为底层协议-为什么不RPC?
我有一个属性文件(键/值)对,我从当前读取一个键的值,并在UI中显示该值.
复杂性增加了,现在基于某些公式,价值更具动态性.该公式包含一个变量参数,其值I将在运行时获得.
是否有任何Java设计模式来设计此方案.
我想在针对一个键的属性文件中放置一个方法名称.
现在我将读取密钥并获取方法名称.此方法将计算该特定键的值.
请让我知道你的建议
在JPQL中,什么是转义字符,我们可以用来转义字符,如"'"
例如:我正在做类似的事情
"......其中person.name ='安迪'"
这里工作正常
但当人名是安迪的时候,那么where子句变得像
"......其中person.name ='安迪''
并且它返回错误说
例如:选择不同的新 JPQA.QueryResultObjectV1(space.name,spaceID) " + " from Space space,Buildingbuilding,Floor Floor join space.guid.oid spaceID " +........... N 这有效美好的
现在,当我尝试添加 MUL 静态函数(这是类路径中可用的静态方法)时,出现如下错误 select unique new JPQA.QueryResultObjectV1(space.name, JPQATestClient.Mul(10,20) ,spaceID) " + " from Space space,Building 建筑,Floor 地板 加入 space.guid.oid spaceID