Java can';t在目标文件夹(maven)上生成zip-with-dependencies.zip文件

Java can';t在目标文件夹(maven)上生成zip-with-dependencies.zip文件,java,maven,cucumber,testng,appium,Java,Maven,Cucumber,Testng,Appium,我正在尝试在目标文件夹中生成zip文件,但无法。当我运行以下命令时,maven构建成功 mvn clean package -DskipTests=true 并且还生成了jar文件&tests.jar文件 但是没有生成zip-with-dependencies.zip文件,只生成jars文件。这里怎么了 pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project

我正在尝试在目标文件夹中生成zip文件,但无法。当我运行以下命令时,maven构建成功

mvn clean package -DskipTests=true
并且还生成了jar文件&tests.jar文件 但是没有生成zip-with-dependencies.zip文件,只生成jars文件。这里怎么了

pom.xml:

<?xml version="1.0"  encoding="UTF-8"?>
<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>org.example</groupId>
    <artifactId>Nana</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.0.0</version>
        </dependency>


        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.141.59</version>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
        </dependency>
        <!-- API, java.xml.bind module -->
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>2.3.2</version>
        </dependency>

        <!-- Runtime, com.sun.xml.bind module -->
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.2</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>gherkin</artifactId>
            <version>2.12.2</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-picocontainer</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vimalselvam</groupId>
            <artifactId>cucumber-extentsreport</artifactId>
            <version>2.0.5</version>
        </dependency>
        <dependency>
            <groupId>com.aventstack</groupId>
            <artifactId>extentreports</artifactId>
            <version>3.1.1</version>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>3.0.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>3.7.1</version>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.github.javafaker/javafaker -->
        <dependency>
            <groupId>com.github.javafaker</groupId>
            <artifactId>javafaker</artifactId>
            <version>1.0.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/uk.ac.gate.plugins/lang-arabic -->
        <dependency>
            <groupId>uk.ac.gate.plugins</groupId>
            <artifactId>lang-arabic</artifactId>
            <version>8.6</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>6.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20190722</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>



    </dependencies>

    <profiles>

        <profile>
            <id>full</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>environment</name>
                    <value>regression</value>
                </property>
            </activation>
            <properties>
                <testNGSuite>testng.xml</testNGSuite>
            </properties>
        </profile>
    </profiles>


    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>


                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.5.4</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <finalName>zip-with-dependencies</finalName>
                                <appendAssemblyId>false</appendAssemblyId>
                                <descriptors>
                                    <descriptor>src/main/java/assembly/zip.xml</descriptor>
                                </descriptors>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>

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


                        <source>8</source>
                        <target>8</target>

                    </configuration>



                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                    <configuration>
                        <suiteXmlFiles>
                            <!--suiteXmlFile>${testNGSuite}</suiteXmlFile-->
                        </suiteXmlFiles>
                    </configuration>

                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
org.example
娜娜
1.0-快照
罐子
木卫一
java客户端
7.0.0
org.seleniumhq.selenium
硒爪哇
3.141.59
信息杯
黄瓜核
1.2.5
信息杯
黄瓜爪哇
1.2.5
jakarta.xml.bind
jakarta.xml.bind-api
2.3.2
org.glassfish.jaxb
jaxb运行时
2.3.2
信息杯
黄瓜试验
1.2.5
信息杯
小黄瓜
2.12.2
假如
公地小海狸
公地小海狸
1.9.3
测试
信息杯
黄瓜皮容器
1.2.5
测试
com.vimalselvam
黄瓜延伸报告
2.0.5
com.aventstack
扩展端口
3.1.1
放心吧
放心
3.0.2
测试
io.github.bonigarcia
webdrivermanager
3.7.1
测试
com.github.javafaker
爪哇骗子
1.0.1
uk.ac.gate.plugins
阿拉伯语
8.6
org.testng
testng
7.1.0
测试
黄瓜
黄瓜试验
6.5.0
测试
org.json
json
20190722
com.googlecode.json-simple
简单json
1.1
满的
真的
环境
回归
testng.xml
org.apache.maven.plugins
maven jar插件
2.6
试验罐
org.apache.maven.plugins
maven依赖插件
2.10
复制依赖项
包裹
复制依赖项
${project.build.directory}/dependency jars/
maven汇编插件
2.5.4
包裹
单一的
带依赖项的压缩
假的
src/main/java/assembly/zip.xml
maven编译器插件
1.7
1.7
org.apache.maven.plugins
maven编译器插件
3.8.1
8.
8.
org.apache.maven.plugins
maven surefire插件
3.0.0-M5
org.apache.maven.plugins
maven编译器插件
3.8.1
8.
8.
zip.xml:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
    <id>zip</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>${project.build.directory}</directory>
            <outputDirectory>./</outputDirectory>
            <includes>
                <include>*.jar</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}</directory>
            <outputDirectory>./</outputDirectory>
            <includes>
                <include>/dependency-jars/</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>

拉链
拉链
假的
${project.build.directory}
./
*jar先生
${project.build.directory}
./
/依赖罐子/
日志:

omyma@ubuntu:~/shopper automation$mvn clean安装-DskipTests=true
警告:发生了非法的反射访问操作
警告:com.google.inject.internal.cglib.core.$reflecturatils$1(文件:/usr/share/maven/lib/guice.jar)对方法java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)的非法反射访问
警告:请考虑将此报告给COM。谷歌。
警告:使用--非法访问=警告t
omyma@ubuntu:~/shopper-automation$ mvn clean install -DskipTests=true
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.example:Nana:jar:1.0-SNAPSHOT
[WARNING] 'build.pluginManagement.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 221, column 25
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] --------------------------< org.example:Nana >--------------------------
[INFO] Building Nana 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Nana ---
[INFO] Deleting /home/omyma/shopper-automation/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Nana ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/omyma/shopper-automation/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ Nana ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Nana ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/omyma/shopper-automation/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ Nana ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 11 source files to /home/omyma/shopper-automation/target/test-classes
[INFO] /home/omyma/shopper-automation/src/test/java/step_definition/MyStepdefs.java: /home/omyma/shopper-automation/src/test/java/step_definition/MyStepdefs.java uses or overrides a deprecated API.
[INFO] /home/omyma/shopper-automation/src/test/java/step_definition/MyStepdefs.java: Recompile with -Xlint:deprecation for details.
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ Nana ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ Nana ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/omyma/shopper-automation/target/Nana-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.6:test-jar (default) @ Nana ---
[INFO] Building jar: /home/omyma/shopper-automation/target/Nana-1.0-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ Nana ---
[INFO] Installing /home/omyma/shopper-automation/target/Nana-1.0-SNAPSHOT.jar to /home/omyma/.m2/repository/org/example/Nana/1.0-SNAPSHOT/Nana-1.0-SNAPSHOT.jar
[INFO] Installing /home/omyma/shopper-automation/pom.xml to /home/omyma/.m2/repository/org/example/Nana/1.0-SNAPSHOT/Nana-1.0-SNAPSHOT.pom
[INFO] Installing /home/omyma/shopper-automation/target/Nana-1.0-SNAPSHOT-tests.jar to /home/omyma/.m2/repository/org/example/Nana/1.0-SNAPSHOT/Nana-1.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.850 s
[INFO] Finished at: 2020-11-14T05:49:15-08:00