Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Maven将插件使用的JAR复制到单个文件夹_Maven - Fatal编程技术网

使用Maven将插件使用的JAR复制到单个文件夹

使用Maven将插件使用的JAR复制到单个文件夹,maven,Maven,在我的POM.xml中,除了插件配置之外,我不需要配置任何依赖项来运行插件。我想将插件(SOAPUIMaven插件)使用的依赖JAR从存储库下载到一个文件夹中。我尝试了命令“mvn dependency:copy dependencies”,但没有复制JAR。有什么办法吗 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:s

在我的POM.xml中,除了插件配置之外,我不需要配置任何依赖项来运行插件。我想将插件(SOAPUIMaven插件)使用的依赖JAR从存储库下载到一个文件夹中。我尝试了命令“mvn dependency:copy dependencies”,但没有复制JAR。有什么办法吗

<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>service.report</groupId>
<artifactId>service-report</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>  
<build>
    <plugins>
        <plugin>           
        <groupId>com.smartbear.soapui</groupId>
        <artifactId>soapui-maven-plugin</artifactId>
        <version>5.0.0</version>            
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>loadtest</goal>
                        </goals>
                        <configuration>                             
                            <projectFile>${basedir}/src/main/resources/xxxxx-soapui-project.xml</projectFile>
                            <testSuite>xxxx</testSuite>
                            <testCase>sssss</testCase>
                            <loadTest>LoadTest 1</loadTest>
                            <outputFolder>${basedir}/target/surefire</outputFolder>
                            <junitReport>true</junitReport>
                            <exportAll>true</exportAll>
                            <printReport>true</printReport>
                            <testFailIgnore>false</testFailIgnore>
                            <!-- <projectProperties>
                                <value>message=Hello World!</value>
                            </projectProperties> -->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
    </plugins>
</build>    

4.0.0
服务报告
服务报告
罐子
1.0-快照
Maven 2 SoapUI示例
com.smartbear.soapui
soapui maven插件
5.0.0            
测试
负荷试验
${basedir}/src/main/resources/xxxxx-soapui-project.xml
xxxx
SSS
负载测试1
${basedir}/target/surefire
真的
真的
真的
假的

mvn依赖项:复制依赖项仅应用于当前maven模块。它在插件上不起作用。若要下载所有SOAPUIMaven插件依赖项,需要从SOAPUIMaven插件项目执行命令。您可以按照以下步骤操作。我假设您熟悉GIT CLI。如果没有,则需要从手动下载

您可以在soapui/soapui-maven-plugin/target/dependency中获得依赖项列表(总共82个文件)


如果出现上述错误,则意味着您的maven jdk版本为jdk.1.7(u6或更早版本),未随javafx一起安装。在下载javafx附带的较新jdk。请记住,将maven jdk更改为这个较新的jdk

如果您想使用依赖插件,可以将依赖项添加到pom…并使用依赖插件下载

它对我很有效

<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>com.ab.forge.utility.copydependenciespom</groupId>
<artifactId>copydependenciespom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<!-- BINARIES -->
<dependencies>
    <!--CUSTOMER RETURN -->
    <dependency>
        <groupId>com.ab...</groupId>
        <artifactId>customerret.....</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <overWriteIfNewer>true</overWriteIfNewer>
                        <overWriteReleases>true</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>

                        <excludeGroupIds>com.ab.ah.scad.acl</excludeGroupIds>
                        <excludeTypes>pom</excludeTypes>
                        <includeGroupIds>com.ab.oneleo</includeGroupIds>
                        <outputDirectory>${outputDirectory}</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

4.0.0
com.ab.forge.utility.copydependenciespom
copydependenciespom
0.0.1-快照
聚甲醛
com.ab。。。
客户网。。。。。
1.0-快照
编译
maven依赖插件
安装
复制依赖项
真的
真的
真的
com.ab.ah.scad.acl
聚甲醛
com.ab.oneleo
${outputDirectory}

在我通过-DoutputDirectory参数运行安装之后

试试这个


要查看所有插件依赖项,您可以在pom上运行dependency:树(插件的配置位置)

为什么要复制它们?你的目标是什么?
[ERROR] Failed to execute goal on project soapui-maven-plugin: Could not resolve dependencies for project com.smartbear.soapui:soapui-maven-plugin:maven-plugin:5.0.0: Could not find artifact javafx:jfxrt:jar:2.2 at specified path (your jdk path)
<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>com.ab.forge.utility.copydependenciespom</groupId>
<artifactId>copydependenciespom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<!-- BINARIES -->
<dependencies>
    <!--CUSTOMER RETURN -->
    <dependency>
        <groupId>com.ab...</groupId>
        <artifactId>customerret.....</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <overWriteIfNewer>true</overWriteIfNewer>
                        <overWriteReleases>true</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>

                        <excludeGroupIds>com.ab.ah.scad.acl</excludeGroupIds>
                        <excludeTypes>pom</excludeTypes>
                        <includeGroupIds>com.ab.oneleo</includeGroupIds>
                        <outputDirectory>${outputDirectory}</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>