[ 
https://issues.apache.org/jira/browse/MDEP-598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358617#comment-16358617
 ] 

Sam Yi commented on MDEP-598:
-----------------------------

Steps to reproduce:
 # Download portable-pypy @ 
[https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.10.0-linux_x86_64-portable.tar.bz2]
 # Run the following:
{code:java}
mvn install:install-file -DgroupId=com.github.squeaky-pl 
-DartifactId=portable-pypy -Dversion=5.10.0 
-Dfile=pypy-5.10.0-linux_x86_64-portable.tar.bz2 -DgeneratePom=true 
-Dpackaging=tar.bz2{code}
 # Include the following in your pom.xml:{code}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>2.10</version>
  <executions>
    <execution>
      <id>copy-pypy</id>
      <phase>process-resources</phase>
      <goals>
        <goal>unpack</goal>
      </goals>
      <configuration>
        <artifactItems>
          <artifactItem>
            <groupId>com.github.squeaky-pl</groupId>
            <artifactId>portable-pypy</artifactId>
            <version>5.10.0</version>
            <type>tar.bz2</type>
          </artifactItem>
        </artifactItems>
        <outputDirectory>/tmp</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>{code}


> CLONE - Unpack goal fails in java versions earlier than 7
> ---------------------------------------------------------
>
>                 Key: MDEP-598
>                 URL: https://issues.apache.org/jira/browse/MDEP-598
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: unpack
>    Affects Versions: 2.10, 3.0.2
>            Reporter: Sam Yi
>            Assignee: Robert Scholte
>            Priority: Major
>
> Cloning this ticket as the original was closed without resolution.  This 
> issue persists (even in 3.0.2), but it should be noted that it only seems to 
> occur when unpacking tar.bz2 or tar.gz.  I did some digging and found that 
> MDEP-68 brought in plexus-archiver fix 
> 271ba64cf6b2e303d473dab4bb0bf3640f22e46e.  This commit modifies 
> PlexusIoBzip2ResourceCollection and PlexusIoGzipResourceCollection to import 
> org.codehaus.plexus.components.io.attributes.Java7AttributeUtils and 
> org.codehaus.plexus.components.io.attributes.Java7FileAttributes which 
> contains code that requires Java 7+.
>  
> Original ticket description follows:
>  
> When using the unpack goal with Java 1.5 or 1.6, the following error message 
> will appear:
> {{[ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack (unpack) on 
> project ID-JRE_8.0: Execution unpack of goal 
> org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack failed: An API 
> incompatibility was encountered while executing 
> org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack: 
> java.lang.NoSuchMethodError: java.io.File.toPath()Ljava/nio/file/Path;}}
> This is obviously calling a method introduced in Java 7. This contradicts the 
> about page[1] that indicates that JDK 1.5 is the minimum required.
> This bug does not appear until version 2.10. Version 2.9 works fine.
> [1] 
> [http://maven.apache.org/plugins-archives/maven-dependency-plugin-2.10/project-summary.html]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to