proguard: 无法读取 [C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar]

huangapple go评论91阅读模式
英文:

proguard: Can't read [C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar]

问题

I am building a desktop application. I am using ProGuard with the following config:

@proguard_jmods.cfg
#-dontshrink
-dontoptimize
#-dontobfuscate


-repackageclasses ''
-renamesourcefileattribute SourceFile
-keepattributes *Annotation*,Signature,Annotation,InnerClasses,EnclosingMethod,SourceFile,LineNumberTable
-adaptresourcefilenames
-dontnote
-dontwarn com.ctc.wstx.**,com.github.**,com.jolbox.bonecp.**,com.mchange.v2.**,com.sun.istack.**,com.sun.tools.**,com.healthmarketscience.**,com.healthmarketscience.**,org.codehaus.**,org.iq80.snappy.**,com.sun.xml.**,com.thoughtworks.xstream.**,de.l3s.boilerpipe.**,javax.activation.**,javax.transaction.**,net.sf.ehcache.**,opennlp.tools.util.**,org.apache.cxf.**,org.apache.log4j.**,org.apache.poi.**,org.apache.sis.**,org.apache.**,org.dom4j.**,org.codehaus.plexus.**,javax.enterprise.**,org.glassfish.**,org.jdesktop.**,org.quartz.**,com.sun.org.**,javax.imageio.metadata.**,javax.xml.**,javax.jws.**,org.w3c.dom.**,org.xml.sax.**,au.com.bytecode.**,com.fasterxml.jackson.**,com.google.common.**,com.google.gson.**,com.googlecode.mp4parser.**,com.itextpdf.**,com.mchange.v1.**,com.microsoft.schemas.**,com.strobel.assembler.**,com.strobel.compilerservices.**,examples.RCallerScriptEngineExample1.**,examples.RCallerScriptEngineExample2.**,examples.RCallerScriptEngineExample2.**,examples.RCallerScriptEngineExample3.**,javassist.util.HotSwapAgent.**,javassist.util.HotSwapper.**,javax.rmi.CORBA.**,javax.rmi.CORBA.**,javax.rmi.PortableRemoteObject.**,org.bouncycastle.**,org.cyberneko.**,org.eclipse.jetty.**,org.etsi.uri.**,org.jboss.com.**,org.jdom2.**,org.jfree.**,org.joda.time.**,org.terracotta.quartz.**,ucar.nc2.grib.**,javax.imageio.metadata.**,com.jmatio.io.**,javax.script.**,com.sun.**,java.rmi.**,opennlp.tools.sentiment.**,java.lang.**,java.util.**,sun.misc.Unsafe.**,sun.**,org.w3.**,net.sf.ehcache.distribution.**,org.apache.http.**,org.apache.any23.**,com.graphbuilder.curve.**,com.strobel.decompiler.**,com.uwyn.jhighlight.**,rg.codehaus.stax2.**,org.openxmlformats.schemas.**,org.springframework.**,org.slf4j.**,com.mysql.**,org.pushingpixels.**,org.hibernate.**,org.jboss.**,net.bytebuddy.**,javax.persistence.**,org.eclipse.**,java.awt.datatransfer.**,java.sql.**,org.objectweb.**,org.apache.any23.**
-ignorewarnings
-verbose
-printseeds seed

# Keep - Applications. Keep all application classes, along with their 'main' methods.
-keepclasseswithmembers public class * {
    public static void main(java.lang.String[]);
}

-keep interface *
-keepnames class ** implements com.xxx.xx.utils.ISerialisable
-keepclassmembers class ** implements com.xxx.xx.utils.ISerialisable {
  <fields>;
  }

-keep,allowshrinking class ** extends com.xxx.xx.utils.ISerialisable

# Keep - Applications. Keep all application classes, along with their 'main' methods.
-keepclasseswithmembers public class * {
    public static void main(java.lang.String[]);
}

# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum  * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver

# Keep - Native method names. Keep all native class/method names.
-keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
    native <methods>;
}

where proguard_jmods.cfg contains the following:

-libraryjars 'C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.base.jmod'
-libraryjars 'C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.desktop.jmod'
-libraryjars 'C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.xml.jmod'

When Run As>Maven Install, I get the following exception thrown:

[proguard] java.io.IOException: Can't read [C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar] (No such file or directory: C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar)

I check the path for that file, and I don't have it. Any idea how to fix this please?
Thank you!

Edit:
Pom file:

<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>xxx</groupId>
    <artifactId>xxxx</artifactId>
    <version>0.0.2</version>
    <name>xxxx</name>
    
    <!-- Properties -->
    <properties>
        <jre.version>jre11</jre.version>
        <java.version>11</java.version>
        <jdk.version>11</jdk.version>
        <jodatime.version>2.5</jodatime.version>
        <junit.version>4.13</junit.version>
        <maven.test.skip>true</maven.test.skip>
        <proguard.skip>false</proguard.skip>
    </properties>

    <!-- Repositories -->
    <repositories>
        <repository>
            <releases>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>bedatadriven</id>
            <name>bedatadriven public repo</name>
            <url>https://nexus.bedatadriven.com/content/groups

<details>
<summary>英文:</summary>

I am building a desktop application. I am using ProGuard with the following config:

    @proguard_jmods.cfg
    #-dontshrink
    -dontoptimize
    #-dontobfuscate
    
    
    -repackageclasses &#39;&#39;
    -renamesourcefileattribute SourceFile
    -keepattributes *Annotation*,Signature,Annotation,InnerClasses,EnclosingMethod,SourceFile,LineNumberTable
    -adaptresourcefilenames
    -dontnote
    -dontwarn com.ctc.wstx.**,com.github.**,com.jolbox.bonecp.**,com.mchange.v2.**,com.sun.istack.**,com.sun.tools.**,com.healthmarketscience.**,com.healthmarketscience.**,org.codehaus.**,org.iq80.snappy.**,com.sun.xml.**,com.thoughtworks.xstream.**,de.l3s.boilerpipe.**,javax.activation.**,javax.transaction.**,net.sf.ehcache.**,opennlp.tools.util.**,org.apache.cxf.**,org.apache.log4j.**,org.apache.poi.**,org.apache.sis.**,org.apache.**,org.dom4j.**,org.codehaus.plexus.**,javax.enterprise.**,org.glassfish.**,org.jdesktop.**,org.quartz.**,com.sun.org.**,javax.imageio.metadata.**,javax.xml.**,javax.jws.**,org.w3c.dom.**,org.xml.sax.**,au.com.bytecode.**,com.fasterxml.jackson.**,com.google.common.**,com.google.gson.**,com.googlecode.mp4parser.**,com.itextpdf.**,com.mchange.v1.**,com.microsoft.schemas.**,com.strobel.assembler.**,com.strobel.compilerservices.**,examples.RCallerScriptEngineExample1.**,examples.RCallerScriptEngineExample2.**,examples.RCallerScriptEngineExample2.**,examples.RCallerScriptEngineExample3.**,javassist.util.HotSwapAgent.**,javassist.util.HotSwapper.**,javax.rmi.CORBA.**,javax.rmi.CORBA.**,javax.rmi.PortableRemoteObject.**,org.bouncycastle.**,org.cyberneko.**,org.eclipse.jetty.**,org.etsi.uri.**,org.jboss.com.**,org.jdom2.**,org.jfree.**,org.joda.time.**,org.terracotta.quartz.**,ucar.nc2.grib.**,javax.imageio.metadata.**,com.jmatio.io.**,javax.script.**,com.sun.**,java.rmi.**,opennlp.tools.sentiment.**,java.lang.**,java.util.**,sun.misc.Unsafe.**,sun.**,org.w3.**,net.sf.ehcache.distribution.**,org.apache.http.**,org.apache.any23.**,com.graphbuilder.curve.**,com.strobel.decompiler.**,com.uwyn.jhighlight.**,rg.codehaus.stax2.**,org.openxmlformats.schemas.**,org.springframework.**,org.slf4j.**,com.mysql.**,org.pushingpixels.**,org.hibernate.**,org.jboss.**,net.bytebuddy.**,javax.persistence.**,org.eclipse.**,java.awt.datatransfer.**,java.sql.**,org.objectweb.**,org.apache.any23.**
    -ignorewarnings
    -verbose
    -printseeds seed
    
    # Keep - Applications. Keep all application classes, along with their &#39;main&#39; methods.
    -keepclasseswithmembers public class * {
        public static void main(java.lang.String[]);
    }
    
    -keep interface *
    -keepnames class ** implements com.xxx.xx.utils.ISerialisable
    -keepclassmembers class ** implements com.xxx.xx.utils.ISerialisable {
      &lt;fields&gt;;
      }
    
    -keep,allowshrinking class ** extends com.xxx.xx.utils.ISerialisable
    
    # Keep - Applications. Keep all application classes, along with their &#39;main&#39; methods.
    -keepclasseswithmembers public class * {
        public static void main(java.lang.String[]);
    }
    
    # Also keep - Enumerations. Keep the special static methods that are required in
    # enumeration classes.
    -keepclassmembers enum  * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    
    # Also keep - Database drivers. Keep all implementations of java.sql.Driver.
    -keep class * extends java.sql.Driver
    
    # Keep - Native method names. Keep all native class/method names.
    -keepclasseswithmembers,includedescriptorclasses,allowshrinking class * {
        native &lt;methods&gt;;
    }

where proguard_jmods.cfg contains the following:

    -libraryjars &#39;C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.base.jmod&#39;
    -libraryjars &#39;C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.desktop.jmod&#39;
    -libraryjars &#39;C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\jmods\java.xml.jmod&#39;

When Run As&gt;Maven Install, I get the following exception thrown:

    [proguard] java.io.IOException: Can&#39;t read [C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar] (No such file or directory: C:\Program Files\AdoptOpenJDK\jdk-11.0.6.10-hotspot\lib\rt.jar)

I check the path for that file, and I don&#39;t have it. Any idea how to fix this please?
Thank you!

Edit:
Pom file:

    &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
    	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    	xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    	&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    	&lt;groupId&gt;xxx&lt;/groupId&gt;
    	&lt;artifactId&gt;xxxx&lt;/artifactId&gt;
    	&lt;version&gt;0.0.2&lt;/version&gt;
    	&lt;name&gt;xxxx&lt;/name&gt;
    	
    	&lt;properties&gt;
    		&lt;jre.version&gt;jre11&lt;/jre.version&gt;
    		&lt;java.version&gt;11&lt;/java.version&gt;
    		&lt;jdk.version&gt;11&lt;/jdk.version&gt;
    		&lt;jodatime.version&gt;2.5&lt;/jodatime.version&gt;
    		&lt;junit.version&gt;4.13&lt;/junit.version&gt;
    		&lt;maven.test.skip&gt;true&lt;/maven.test.skip&gt;
    		&lt;proguard.skip&gt;false&lt;/proguard.skip&gt;
    	&lt;/properties&gt;
    
    	&lt;repositories&gt;
    		&lt;repository&gt;
    			&lt;releases&gt;
    				&lt;updatePolicy&gt;daily&lt;/updatePolicy&gt;
    			&lt;/releases&gt;
    			&lt;snapshots&gt;
    				&lt;enabled&gt;false&lt;/enabled&gt;
    			&lt;/snapshots&gt;
    			&lt;id&gt;central&lt;/id&gt;
    			&lt;name&gt;Maven Repository Switchboard&lt;/name&gt;
    			&lt;url&gt;https://repo1.maven.org/maven2&lt;/url&gt;
    		&lt;/repository&gt;
    		&lt;repository&gt;
    			&lt;id&gt;bedatadriven&lt;/id&gt;
    			&lt;name&gt;bedatadriven public repo&lt;/name&gt;
    			&lt;url&gt;https://nexus.bedatadriven.com/content/groups/public/&lt;/url&gt;
    		&lt;/repository&gt;
    		&lt;repository&gt;
    			&lt;id&gt;oss.sonatype.org-snapshot&lt;/id&gt;
    			&lt;url&gt;http://oss.sonatype.org/content/repositories/snapshots&lt;/url&gt;
    			&lt;releases&gt;
    				&lt;enabled&gt;false&lt;/enabled&gt;
    			&lt;/releases&gt;
    			&lt;snapshots&gt;
    				&lt;enabled&gt;true&lt;/enabled&gt;
    			&lt;/snapshots&gt;
    		&lt;/repository&gt;
    	&lt;/repositories&gt;
    
    	&lt;pluginRepositories&gt;
    		&lt;pluginRepository&gt;
    			&lt;releases&gt;
    				&lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
    			&lt;/releases&gt;
    			&lt;snapshots&gt;
    				&lt;enabled&gt;false&lt;/enabled&gt;
    			&lt;/snapshots&gt;
    			&lt;id&gt;central&lt;/id&gt;
    			&lt;name&gt;Maven Repository Switchboard&lt;/name&gt;
    			&lt;url&gt;https://repo1.maven.org/maven2&lt;/url&gt;
    		&lt;/pluginRepository&gt;
    	&lt;/pluginRepositories&gt;
    	&lt;dependencyManagement&gt;
    		&lt;dependencies&gt;
    			&lt;dependency&gt;
    				&lt;groupId&gt;com.xxxx&lt;/groupId&gt;
    				&lt;artifactId&gt;x&lt;/artifactId&gt;
    				&lt;version&gt;0.0.2&lt;/version&gt;
    				&lt;type&gt;pom&lt;/type&gt;
    				&lt;scope&gt;import&lt;/scope&gt;
    			&lt;/dependency&gt;
    		&lt;/dependencies&gt;
    	&lt;/dependencyManagement&gt;
    	&lt;dependencies&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;junit&lt;/groupId&gt;
    			&lt;artifactId&gt;junit&lt;/artifactId&gt;
    			&lt;scope&gt;test&lt;/scope&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;com.google.guava&lt;/groupId&gt;
    			&lt;artifactId&gt;guava&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
    			&lt;artifactId&gt;spark-sql_2.12&lt;/artifactId&gt;
    			&lt;exclusions&gt;
    				&lt;exclusion&gt;
    					&lt;groupId&gt;xml-apis&lt;/groupId&gt;
    					&lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
    				&lt;/exclusion&gt;
    
    			&lt;/exclusions&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
    			&lt;artifactId&gt;spark-mllib_2.12&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
    			&lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
    			&lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
    			&lt;artifactId&gt;ooxml-schemas&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;net.sf.opencsv&lt;/groupId&gt;
    			&lt;artifactId&gt;opencsv&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    
    		&lt;dependency&gt;
    			&lt;groupId&gt;com.crealytics&lt;/groupId&gt;
    			&lt;artifactId&gt;spark-excel_2.12&lt;/artifactId&gt;
    			&lt;exclusions&gt;
    				&lt;exclusion&gt;
    					&lt;groupId&gt;xml-apis&lt;/groupId&gt;
    					&lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
    				&lt;/exclusion&gt;
    
    			&lt;/exclusions&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
    			&lt;artifactId&gt;poi&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.codehaus.guessencoding&lt;/groupId&gt;
    			&lt;artifactId&gt;guessencoding&lt;/artifactId&gt;
    			&lt;type&gt;jar&lt;/type&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.jdesktop.swingx&lt;/groupId&gt;
    			&lt;artifactId&gt;jxmapviewer2&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.any23&lt;/groupId&gt;
    			&lt;artifactId&gt;apache-any23-encoding&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    
    		&lt;dependency&gt;
    			&lt;groupId&gt;com.thoughtworks.xstream&lt;/groupId&gt;
    			&lt;artifactId&gt;xstream&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
    			&lt;artifactId&gt;log4j&lt;/artifactId&gt;
    			&lt;type&gt;pom&lt;/type&gt;
    		&lt;/dependency&gt;
    
    		&lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
    			&lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    		&lt;!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core --&gt;
    		&lt;dependency&gt;
    			&lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
    			&lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
    		&lt;/dependency&gt;
    
    	&lt;/dependencies&gt;
    
    	&lt;build&gt;
    		&lt;plugins&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    				&lt;artifactId&gt;versions-maven-plugin&lt;/artifactId&gt;
    				&lt;version&gt;2.10&lt;/version&gt;
    				&lt;configuration&gt;
    					&lt;generateBackupPoms&gt;false&lt;/generateBackupPoms&gt;
    				&lt;/configuration&gt;
    			&lt;/plugin&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    				&lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
    				&lt;version&gt;3.0&lt;/version&gt;
    				&lt;configuration&gt;
    					&lt;downloadSources&gt;true&lt;/downloadSources&gt;
    					&lt;downloadJavadocs&gt;false&lt;/downloadJavadocs&gt;
    				&lt;/configuration&gt;
    			&lt;/plugin&gt;
    
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    				&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
    				&lt;version&gt;3.8.0&lt;/version&gt;
    				&lt;configuration&gt;
    					&lt;source&gt;${jdk.version}&lt;/source&gt;
    					&lt;target&gt;${jdk.version}&lt;/target&gt;
    				&lt;/configuration&gt;
    			&lt;/plugin&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    				&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
    				&lt;version&gt;3.0.0-M4&lt;/version&gt;
    				&lt;configuration&gt;
    					&lt;argLine&gt;
    						--illegal-access=permit
    					&lt;/argLine&gt;
    				&lt;/configuration&gt;
    			&lt;/plugin&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    				&lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
    				&lt;version&gt;3.0.0-M4&lt;/version&gt;
    				&lt;configuration&gt;
    					&lt;argLine&gt;
    						--illegal-access=permit
    					&lt;/argLine&gt;
    				&lt;/configuration&gt;
    			&lt;/plugin&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    				&lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
    				&lt;version&gt;2.3&lt;/version&gt;
    				&lt;executions&gt;
    					&lt;!-- Run shade goal on package phase --&gt;
    					&lt;execution&gt;
    						&lt;phase&gt;package&lt;/phase&gt;
    						&lt;goals&gt;
    							&lt;goal&gt;shade&lt;/goal&gt;
    						&lt;/goals&gt;
    						&lt;id&gt;x&lt;/id&gt;
    						&lt;configuration&gt;
    							&lt;transformers&gt;
    								&lt;transformer
    									implementation=&quot;org.apache.maven.plugins.shade.resource.ManifestResourceTransformer&quot;&gt;
    									&lt;mainClass&gt;com.xxxx.x.exe.x&lt;/mainClass&gt;
    								&lt;/transformer&gt;
    							&lt;/transformers&gt;
    							&lt;filters&gt;
    								&lt;filter&gt;
    									&lt;artifact&gt;*:*&lt;/artifact&gt;
    									&lt;excludes&gt;
    										&lt;exclude&gt;module-info.java&lt;/exclude&gt;
    										&lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
    										&lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
    										&lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
    									&lt;/excludes&gt;
    								&lt;/filter&gt;
    							&lt;/filters&gt;
    							&lt;finalName&gt;${project.artifactId}-${project.version}&lt;/finalName&gt;
    						&lt;/configuration&gt;
    					&lt;/execution&gt;
    				&lt;/executions&gt;
    			&lt;/plugin&gt;
    			&lt;plugin&gt;
    				&lt;groupId&gt;com.github.wvengen&lt;/groupId&gt;
    				&lt;artifactId&gt;proguard-maven-plugin&lt;/artifactId&gt;
    				&lt;version&gt;2.2.0&lt;/version&gt;
    				&lt;executions&gt;
    					&lt;execution&gt;
    						&lt;phase&gt;package&lt;/phase&gt;
    						&lt;goals&gt;
    							&lt;goal&gt;proguard&lt;/goal&gt;
    						&lt;/goals&gt;
    					&lt;/execution&gt;
    				&lt;/executions&gt;
    				&lt;configuration&gt;
    					&lt;proguardVersion&gt;6.2.2&lt;/proguardVersion&gt;
    					&lt;obfuscate&gt;true&lt;/obfuscate&gt;
    					&lt;injar&gt;${project.artifactId}-0.0.2.jar&lt;/injar&gt;
    					&lt;outjar&gt;${project.artifactId}-0.0.2.jar&lt;/outjar&gt;
    					&lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt;
    					&lt;proguardInclude&gt;${basedir}/proguard/proguard.cfg&lt;/proguardInclude&gt;
    					&lt;libs&gt;
    					&lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;
    					&lt;lib&gt;${java.home}/lib/jsse.jar&lt;/lib&gt;
    					&lt;/libs&gt;
    					&lt;skip&gt;${proguard.skip}&lt;/skip&gt;
    				&lt;/configuration&gt;
    				&lt;dependencies&gt;
    					&lt;dependency&gt;
    						&lt;groupId&gt;net.sf.proguard&lt;/groupId&gt;
    						&lt;artifactId&gt;proguard-base&lt;/artifactId&gt;
    						&lt;version&gt;6.2.2&lt;/version&gt;
    						&lt;scope&gt;runtime&lt;/scope&gt;
    					&lt;/dependency&gt;
    				&lt;/dependencies&gt;
    			&lt;/plugin&gt;
    		&lt;/plugins&gt;
    		&lt;pluginManagement&gt;
    			&lt;plugins&gt;
    				&lt;plugin&gt;
    					&lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
    					&lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
    					&lt;version&gt;1.0.0&lt;/version&gt;
    					&lt;configuration&gt;
    						&lt;lifecycleMappingMetadata&gt;
    							&lt;pluginExecutions&gt;
    								&lt;pluginExecution&gt;
    									&lt;pluginExecutionFilter&gt;
    										&lt;groupId&gt; org.apache.maven.plugins &lt;/groupId&gt;
    										&lt;artifactId&gt; maven-compiler-plugin &lt;/artifactId&gt;
    										&lt;versionRange&gt; [2.5.1,) &lt;/versionRange&gt;
    										&lt;goals&gt;
    											&lt;goal&gt;testCompile&lt;/goal&gt;
    										&lt;/goals&gt;
    									&lt;/pluginExecutionFilter&gt;
    									&lt;action&gt;
    										&lt;ignore&gt;&lt;/ignore&gt;
    									&lt;/action&gt;
    								&lt;/pluginExecution&gt;
    							&lt;/pluginExecutions&gt;
    						&lt;/lifecycleMappingMetadata&gt;
    					&lt;/configuration&gt;
    				&lt;/plugin&gt;
    			&lt;/plugins&gt;
    		&lt;/pluginManagement&gt;
    		&lt;resources&gt;
    			&lt;resource&gt;
    				&lt;targetPath&gt;&lt;/targetPath&gt;
    				&lt;filtering&gt;false&lt;/filtering&gt;
    				&lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
    			&lt;/resource&gt;
    			&lt;resource&gt;
    				&lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
    				&lt;filtering&gt;true&lt;/filtering&gt;
    				&lt;includes&gt;
    					&lt;include&gt;**/config.properties&lt;/include&gt;
    				&lt;/includes&gt;
    			&lt;/resource&gt;
    
    			&lt;resource&gt;
    				&lt;targetPath&gt;&lt;/targetPath&gt;
    				&lt;filtering&gt;false&lt;/filtering&gt;
    				&lt;directory&gt;${basedir}/src/main/resources/files&lt;/directory&gt;
    			&lt;/resource&gt;
    
    			&lt;resource&gt;
    				&lt;filtering&gt;false&lt;/filtering&gt;&lt;!-- if it is neccessary --&gt;
    				&lt;directory&gt;${project.basedir}/${jre.version}&lt;/directory&gt;&lt;!-- from --&gt;
    				&lt;targetPath&gt;${project.build.directory}/${jre.version}&lt;/targetPath&gt;&lt;!-- 
    					to --&gt;
    				&lt;includes&gt;&lt;!-- what --&gt;
    					&lt;include&gt;**&lt;/include&gt;
    				&lt;/includes&gt;
    			&lt;/resource&gt;
    		&lt;/resources&gt;
    		&lt;testResources&gt;
    		&lt;/testResources&gt;
    	&lt;/build&gt;
    &lt;/project&gt;

</details>


# 答案1
**得分**: 5

You have the line `<lib>${java.home}/lib/rt.jar</lib>` in your configuration for proguard. This is no longer valid in JDK11 as it was removed in that version of Java.

For newer JDKs, refer to this link: [https://stackoverflow.com/questions/66120628/proguard-cant-read-c-program-files-java-jdk-15-0-1-lib-rt-jar-no-such-file-o](https://stackoverflow.com/questions/66120628/proguard-cant-read-c-program-files-java-jdk-15-0-1-lib-rt-jar-no-such-file-o)

<details>
<summary>英文:</summary>

You have the line `&lt;lib&gt;${java.home}/lib/rt.jar&lt;/lib&gt;`  in your configuration for proguard. This is no longer valid in JDK11 as it was removed in that version of Java.

For newer JDKs, see this: https://stackoverflow.com/questions/66120628/proguard-cant-read-c-program-files-java-jdk-15-0-1-lib-rt-jar-no-such-file-o


</details>



huangapple
  • 本文由 发表于 2020年8月13日 23:56:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/63398875.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定