Ошибка сборки при создании Maven Zip для устройства AWS Farm - PullRequest
0 голосов
/ 07 февраля 2019

Я получаю ошибку сборки при попытке создать zip-файл для моего проекта Appium / selenium.Буду признателен за любую помощь.

Я запускаю это на MacOS HighSierra.Я запускаю это на MacOS HighSierra.Appium - версия v1.10.1.Команда, которую я использовал, чтобы заархивировать файл (или пыталась использовать, чтобы заархивировать файл), находится в первой строке терминала. Это журнал с терминала:

cvarl-0046:powerleyappiumcucumber cvarl$ mvn clean package -DskipTests=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building TestngCucumberBoilerPlate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestngCucumberBoilerPlate ---
[INFO] Deleting /Users/cvarl/Documents/PowerleyAppiumCucumber/target
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/cvarl/Documents/PowerleyAppiumCucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ TestngCucumberBoilerPlate ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 13 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ TestngCucumberBoilerPlate ---
[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 49 source files to /Users/cvarl/Documents/PowerleyAppiumCucumber/target/test-classes
[INFO] /Users/cvarl/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/cvarl/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ TestngCucumberBoilerPlate ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ TestngCucumberBoilerPlate ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/cvarl/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-assembly-plugin:2.5.4:single (default) @ TestngCucumberBoilerPlate ---
[INFO] Reading assembly descriptor: src/main/assembly/zip.xml
[INFO] Building zip: /Users/cvarl/Documents/PowerleyAppiumCucumber/target/zip-with-dependencies.zip
[INFO] 
[INFO] --- maven-dependency-plugin:3.1.1:copy (copy) @ TestngCucumberBoilerPlate ---
[INFO] Configured Artifact: appiumcucumber:appiumcucumberproj:1:.zip
Downloading: https://github.com/igniteram/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1.pom
Downloading: https://repo.maven.apache.org/maven2/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1.pom
[WARNING] The POM for appiumcucumber:appiumcucumberproj:.zip:1 is missing, no dependency information available
Downloading: https://github.com/igniteram/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1..zip
Downloading: https://repo.maven.apache.org/maven2/appiumcucumber/appiumcucumberproj/1/appiumcucumberproj-1..zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.379 s
[INFO] Finished at: 2019-02-06T17:03:10-05:00
[INFO] Final Memory: 25M/94M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy (copy) on project TestngCucumberBoilerPlate: Unable to find/resolve artifact. Could not find artifact appiumcucumber:appiumcucumberproj:.zip:1 in TestNG-Cucumber (https://github.com/igniteram) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
cvarl-0046:powerleyappiumcucumber cvarl$ 

Это мой 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">
    <repositories>
        <repository>
            <id>TestNG-Cucumber</id>
            <name>testng-cucumber</name>
            <url>https://github.com/igniteram</url>
        </repository>
    </repositories>
<packaging>jar</packaging>
    <modelVersion>4.0.0</modelVersion>
  <groupId>TestngCucumber</groupId>
  <artifactId>TestngCucumberBoilerPlate</artifactId>
  <version>0.0.1-SNAPSHOT</version>
<dependencies>
        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency> 

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.1</version>
            <type>maven-plugin</type>
        </dependency>

        <!-- Added for comparing screenshots -->
        <!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
        <dependency>
            <groupId>com.sikulix</groupId>
            <artifactId>sikulixapi</artifactId>
            <version>1.1.0</version>
        </dependency>
</dependencies>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>



    <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/assembly/zip.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
    </plugin>



    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>[ groupId ]</groupId>
                  <artifactId>[ artifactId ]</artifactId>
                  <version>[ version ]</version>
                  <type>[ packaging ]</type>
                  <classifier> [classifier - optional] </classifier>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                  <destFileName>[ filename ]</destFileName>
                </artifactItem>
              </artifactItems>
              <!-- other configurations here -->
            </configuration>
          </execution>
        </executions>
      </plugin>


      <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <version>2.7</version>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-filtering</artifactId>
       <version>1.3</version>
     </dependency>
   </dependencies>
</plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
    </plugins>
  </build>

</project>

1 Ответ

0 голосов
/ 07 февраля 2019

Замена моего подключаемого модуля maven-dependency-plugin в файле pom.xml с помощью приведенного ниже исправила мои ошибки сборки.

    <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>
...