微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

嗨,我正在研究 Cucumber,我正在尝试生成 pdf 报告,在我的 porm 中,我添加了依赖项,但仍然显示缺少 ralfstuckert 的错误

如何解决嗨,我正在研究 Cucumber,我正在尝试生成 pdf 报告,在我的 porm 中,我添加了依赖项,但仍然显示缺少 ralfstuckert 的错误

POM.xml
正如您在以下代码中看到的,我在我的 POM 中添加了 ralfstuckert 依赖项,但仍然显示“缺少工件 com.github.ralfstuckert.pdfBox-layout:pdfBox2-layout:jar:1.0.0”我应该怎么做才能解决这个问题。

<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>Cucumbar_BDD</groupId>
    <artifactId>CucumberJavaHybridFramwork</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

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

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <junit.version>4.13.1</junit.version>
        <cucumber.version>6.9.0</cucumber.version>
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.surefire.version>2.22.2</maven.surefire.version>
    </properties>
    <dependencies>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>4.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.30</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>tech.grasshopper</groupId>
            <artifactId>extentreports-cucumber6-adapter</artifactId>
            <version>2.5.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.ralfstuckert.pdfBox-layout</groupId>
            <artifactId>pdfBox2-layout</artifactId>
            <version>1.0.0</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <includes>
                        <include>**/ParallelRun.java</include>
                    </includes>
                    <parallel>methods</parallel>
                    <threadCount>4</threadCount>
                    <useUnlimitedThreads>false</useUnlimitedThreads>
                </configuration>
            </plugin>

            <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> 
                    <version>3.0.0-M3</version> <executions> <execution> <goals> <goal>integration-test</goal> 
                    </goals> <configuration> UNCOMMENT - To add any exclusions if required <excludes> 
                    <exclude>**/*IT*.java</exclude> </excludes> <includes> UNCOMMENT BELOW LINE 
                    - To execute feature files with a single runner <include>**/MyTestRunner.java</include> 
                    UNCOMMENT BELOW LINE - To execute feature files with multiple runners <include>**/*Runner.java</include> 
                    </includes> UNCOMMENT BELOW 3 LInes - To execute using parallel or combination 
                    option <parallel>methods</parallel> <threadCount>4</threadCount> <perCoreThreadCount>true</perCoreThreadCount> 
                    UNCOMMENT BELOW 3 LInes - To execute using forking or combination option 
                    <forkCount>2</forkCount> <reuseForks>true</reuseForks> <reportsDirectory>${project.build.directory}/failsafe-reports_${surefire.forkNumber}</reportsDirectory> 
                    </configuration> </execution> </executions> </plugin> -->


        </plugins>
    </build>

</project>

错误

缺少工件 com.github.ralfstuckert.pdfBox-layout:pdfBox2-layout:jar:1.0.0

解决方法

我遇到了同样的问题。我使用了以下依赖项:

<dependency>
    <groupId>tech.grasshopper</groupId>
    <artifactId>extentreports-cucumber5-adapter</artifactId>
    <version>2.8.1</version>
    <scope>test</scope>
</dependency>

“extentreports-cucumber5-adapter”与版本 2.8.1 而不是“extentreports-cucumber6-adapter”

这解决了我的问题。你可以参考下面的github链接: https://github.com/grasshopper7/cuke5-extent-adapter-report/blob/master/cuke5-extent-adapter-report/pom.xml

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。