Bug 986909

Summary: Unable to install jar to directory outside %{_javadir} via mvn_file
Product: [Fedora] Fedora Reporter: Robert Rati <rrati>
Component: javapackages-toolsAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: java-sig-commits, mizdebsk, msrb, sochotni, tradej
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.3.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-10 14:51:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert Rati 2013-07-22 12:02:30 UTC
Description of problem:
Trying to install a jar file to a location other than in %{_javadir}, like one using JNI, fails.  The following spec line:
%mvn_file ":%{name}-common" %{_jnidir}/%{name}-common %{_datadir}/%{name}/common/%{name}-common

Produces:
[ERROR] Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:0.5.0:install (default-cli) on project hadoop-main: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:0.5.0:install failed: 'other' is different type of Path -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.fedoraproject.xmvn:xmvn-mojo:0.5.0:install (default-cli) on project hadoop-main: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:0.5.0:install failed: 'other' is different type of Path
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.fedoraproject.xmvn:xmvn-mojo:0.5.0:install failed: 'other' is different type of Path
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 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 org.fedoraproject.maven.installer.DefaultPackage.addJarFile(DefaultPackage.java:152)
	at org.fedoraproject.maven.installer.JarInstaller.installProject(JarInstaller.java:76)
	at org.fedoraproject.maven.rpminstall.plugin.InstallMojo.installProject(InstallMojo.java:87)
	at org.fedoraproject.maven.rpminstall.plugin.InstallMojo.execute(InstallMojo.java:167)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	... 20 more
[ERROR] 
[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/PluginExecutionException


Version-Release number of selected component (if applicable):
xmvn-0.5.0-5.fc19.noarch

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Mikolaj Izdebski 2013-07-22 12:05:35 UTC
Thank you for the report.

Until the bug is fixed you can use the following workaround:

1) disable automatic artifact installation with %mav_package:

  % mvn_package :%{name}-common __noinstall

2) Install the artifact manually (JAR and POM)

3) Install Maven depmap using %add_maven_depmap macro.

Comment 2 Mikolaj Izdebski 2013-07-22 12:07:04 UTC
I comment #1 I meant %mvn_package, not %mav_package

Comment 3 Mikolaj Izdebski 2013-09-25 15:40:48 UTC
Fixed in javapackages-tools-3.2.4-1

Comment 4 Mikolaj Izdebski 2013-10-10 14:51:55 UTC
I believe that this bug is fixed in javapackages-tools-3.3.1-1,
which is available in Fedora 20, so I am closing this bug now.

The build containing the fix can be found at Koji:
http://koji.fedoraproject.org/koji/buildinfo?buildID=469209

This bug was fixed in the next release of Fedora, and is not planned
to be fixed in the release it was filed against.  If you want this bug
to be fixed in updates for Fedora 19, please say so in a comment.
Otherwise you can update to the newer release of Fedora to get the fix.