allure-maven icon indicating copy to clipboard operation
allure-maven copied to clipboard

IllegalArgumentException occurs on report generation

Open sskorol opened this issue 8 years ago • 6 comments

I'm submitting a ...

  • [x] bug report
  • [ ] feature request
  • [ ] support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

IllegalArgumentException occurs on report generation. However, report itself is generated.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  1. Install Java 8 and Java 9.
  2. Set JAVA_HOME pointing to JDK 9 folder.
  3. Force Maven using JDK 8 in IntelliJ configuration.
  4. Run any test using allure-testng adaptor.
  5. Create maven run configuration in IDE with allure:report goal and set JAVA_HOME environment variable pointing to JDK 8 folder.
  6. Run newly create configuration from IDE.

What is the expected behavior?

Report is generated, no exceptions have thrown.

What is the motivation / use case for changing the behavior?

Plugin shouldn't ever throw such exceptions on report generation.

Please tell us about your environment:

Other information

Stacktrace:

[ERROR] Failed to execute goal io.qameta.allure:allure-maven:2.8:report (default-cli) on project allure2-maven-testng-samples: An error has occurred in Allure report generation.: Could not generate the report: 'other' is different type of Path -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.qameta.allure:allure-maven:2.8:report (default-cli) on project allure2-maven-testng-samples: An error has occurred in Allure report generation.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has occurred in Allure report generation.
    at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:171)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 21 more
Caused by: org.apache.maven.reporting.MavenReportException: Could not generate the report
    at io.qameta.allure.maven.AllureGenerateMojo.executeReport(AllureGenerateMojo.java:132)
    at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255)
    at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:143)
    ... 23 more
Caused by: java.lang.IllegalArgumentException: 'other' is different type of Path
    at sun.nio.fs.UnixPath.relativize(UnixPath.java:416)
    at sun.nio.fs.UnixPath.relativize(UnixPath.java:43)
    at io.qameta.allure.maven.AllureGenerateMojo.render(AllureGenerateMojo.java:251)
    at io.qameta.allure.maven.AllureGenerateMojo.executeReport(AllureGenerateMojo.java:130)
    ... 25 more

sskorol avatar Aug 20 '17 15:08 sskorol

I do have the same issue but in my case it is not related to java 9.

Please tell us about your environment: JDK: 1.8.0_152 Allure version: 2.4.1 [email protected] [email protected] [email protected] [email protected]

marcuskaufmann avatar Nov 15 '17 15:11 marcuskaufmann

Same problem, someone fixed?

UrionBlade avatar Jan 22 '18 07:01 UrionBlade

Hi! Could someone solve the problem?

acenturion avatar Jul 24 '18 20:07 acenturion

Could you post your maven dependency

UrionBlade avatar Jul 25 '18 06:07 UrionBlade

Urion, i copy the pom file. when I run the "mvn allure:report" command, it ends with the error attached here:

error

[ERROR] Failed to execute goal io.qameta.allure:allure-maven:2.8:report (default-cli) on project sf2-auto: An error has occurred in Allure report generation.: Could not generate the report: 'other' is different type of Path -> [Help 1] 

pom

<?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.practia.sf2.auto</groupId>
    <artifactId>sf2-auto</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <allure.report.directory>allure-report</allure.report.directory>
        <allure.results.directory>allure-results</allure.results.directory>
        <aspectj.version>1.8.10</aspectj.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit4</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>com.sikulix</groupId>
            <artifactId>sikulixapi</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.17</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.11</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.11.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.17</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>io.qameta.allure.junit4.AllureJunit4</value>
                        </property>
                    </properties>
                    <systemProperties>
                        <property>
                            <name>allure.results.directory</name>
                            <value>target/allure-results</value>
                        </property>
                    </systemProperties>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>2.8</version>
                <configuration>
                    <reportVersion>2.6.0</reportVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <!-- Optional Start -->
                            <finalName>SF2Auto</finalName>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                            <!-- Optional End -->
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>Main</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

acenturion avatar Jul 25 '18 13:07 acenturion

I solved this problem in my project by modifying configuration section of allure-maven plugin with parameter reportingOutputDirectory

stranniytip avatar Jul 30 '18 07:07 stranniytip