0

在根目录中运行mvn package时,我收到以下错误-

 Error: async-http-client-2.12.1.jar is not a multi-release jar file but --multi-release option is set
[ERROR] Failed to execute goal io.github.fvarrui:javapackager:1.5.1:package (default) on project Application: Command execution failed: C:\Program Files\Java\jdk-9.0.4\bin\jdeps -q --multi-release 9 --list-deps C:\Users\admin\Desktop\Application1\target\Application\libs\*.jar C:\Users\admin\Desktop\Application1\target\Application-0.0.1-SNAPSHOT-runnable.jar -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.fvarrui:javapackager:1.5.1:package (default) on project Application: Command execution failed: C:\Program Files\Java\jdk-9.0.4\bin\jdeps -q --multi-release 9 --list-deps C:\Users\admin\Desktop\Application1\target\Application\libs\*.jar C:\Users\admin\Desktop\Application1\target\Application-0.0.1-SNAPSHOT-runnable.jar

这是我的 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>

  <groupId>DesktopApp</groupId>
  <artifactId>Application</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>Application</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java9.sourceDirectory>${project.basedir}/src/main/java9</java9.sourceDirectory>
    <java9.build.outputDirectory>${project.build.directory}/classes-java9</java9.build.outputDirectory>
    <maven.compiler.source>1.9</maven.compiler.source>
    <maven.compiler.target>1.9</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      
      <scope>test</scope>
    </dependency>
  <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.0.0-alpha-7</version>
</dependency>

     <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
         <version>6.8</version>
         <scope>test</scope>
     </dependency>
     
     <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.0-alpha1</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-jdk14</artifactId>
    <version>2.0.0-alpha1</version>
    <scope>runtime</scope>
</dependency> 

<dependency>
            <groupId>org.asynchttpclient</groupId>
            <artifactId>async-http-client-bom</artifactId>
            <version>2.12.1</version>
            <type>pom</type>
            <scope>import</scope>
 </dependency>

<dependency>
    <groupId>com.1stleg</groupId>
    <artifactId>jnativehook</artifactId>
    <version>2.1.0</version>
    
</dependency>
      
  </dependencies>

  
  <build>
  <plugins>
  <plugin>
    <groupId>io.github.fvarrui</groupId>
    <artifactId>javapackager</artifactId>
    <version>1.5.1</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>package</goal>
            </goals>
            <configuration>
            
                <!-- mandatory -->
                <mainClass>Desktop.Application.App</mainClass>
                <!-- optional -->
                <bundleJre>true</bundleJre>
                <generateInstaller>true</generateInstaller>
                <administratorRequired>true</administratorRequired>
                <platform>windows</platform>
                
                <additionalResources>C:\Users\admin\Downloads\jnativehook\jar</additionalResources>
                
            </configuration>
        </execution>
    </executions>
</plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
</plugin>


<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
        <archive>
            <manifestEntries>
                <Multi-Release>true</Multi-Release>
            </manifestEntries>
        </archive>
    </configuration>
</plugin>
  
      
  </plugins>
  </build>
  
</project>
4

0 回答 0