You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stijn Koopal (JIRA)" <ji...@apache.org> on 2016/07/20 09:20:20 UTC

[jira] [Created] (MPLUGIN-306) %2 in filepath throws Exception with maven-plugin-plugin

Stijn Koopal created MPLUGIN-306:
------------------------------------

             Summary: %2 in filepath throws Exception with maven-plugin-plugin
                 Key: MPLUGIN-306
                 URL: https://issues.apache.org/jira/browse/MPLUGIN-306
             Project: Maven Plugin Tools
          Issue Type: Bug
          Components: Plugin Plugin
    Affects Versions: 3.3
            Reporter: Stijn Koopal


When the characters %2 are present in the path to a project that contains a maven plugin, the maven-plugin-plugin will fail during compile time.

The exception is different for local building and for jenkins building:

Exception on local build:
{noformat}
Caused by: java.lang.IllegalArgumentException
        at sun.net.www.ParseUtil.decode(ParseUtil.java:202)
        at sun.net.www.protocol.file.Handler.openConnection(Handler.java:82)
        at sun.net.www.protocol.file.Handler.openConnection(Handler.java:72)
        at java.net.URL.openConnection(URL.java:979)
{noformat}

Exception on jenkins:
{noformat}
Caused by: java.lang.RuntimeException: Cannot read file : TestMojo.java
	at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:457)
	at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:476)
	at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
{noformat}

Test setup (have to do it in ticket, network policy does not allow me to share files):

{code:java|title=TestMojo.java}
import org.apache.maven.plugin.AbstractMojo; 
import org.apache.maven.plugin.MojoExecutionException; 
import org.apache.maven.plugin.MojoFailureException; 
import org.apache.maven.plugins.annotations.Mojo;

@Mojo(name = "test")
public class TestMojo extends AbstractMojo {

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        
    }
}
{code}

{code:xml|title=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>test.maven.plugins</groupId>
    <artifactId>test-maven-plugin</artifactId>&#xD;
    <version>1.0.0-SNAPSHOT</version>
    <packaging>maven-plugin</packaging>

    <properties>
        <maven.version>3.3.9</maven.version>
        <maven-plugin-annotations.version>3.4</maven-plugin-annotations.version>
        <maven-plugin-testing-harness.version>3.3.0</maven-plugin-testing-harness.version>
    </properties>

    <dependencies>
        <!-- Maven plugins -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-plugin-annotations.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>${maven-plugin-testing-harness.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-aether-provider</artifactId>
            <version>${maven.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>${maven.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <goalPrefix>kjar</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                    <execution>
                        <id>help-descriptor</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)