Bug 1078967
| Summary: | xmvn: generates bad reactor file from maven-jar-plugin with classifier | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Pete MacKinnon <pmackinn> | ||||||
| Component: | xmvn | Assignee: | Mikolaj Izdebski <mizdebsk> | ||||||
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | unspecified | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | rawhide | CC: | java-sig-commits, mizdebsk, msimacek, msrb, sochotni | ||||||
| Target Milestone: | --- | Keywords: | Triaged, Upstream, VerifiedUpstream | ||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 1.5.0-0.24.gitcb3a0a6 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-04-01 10:40:19 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: | |||||||||
| Attachments: |
|
||||||||
Created attachment 876931 [details]
reproducer
Steps to reproduce:
mock maven-downloader-1.1-5.fc20.src.rpm
Actual results:
+ xmvn-install -R .xmvn-reactor -n maven-downloader -d /builddir/build/BUILDROOT/maven-downloader-1.1-5.fc21.x86_64
Unhandled exception
java.lang.RuntimeException: Failed to install project
at org.fedoraproject.xmvn.tools.install.impl.DefaultInstaller.install(DefaultInstaller.java:415)
at org.fedoraproject.xmvn.tools.install.InstallerCli.run(InstallerCli.java:142)
at org.fedoraproject.xmvn.tools.install.InstallerCli.main(InstallerCli.java:156)
Caused by: java.io.IOException: Is a directory
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:149)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.PushbackInputStream.read(PushbackInputStream.java:186)
at java.util.zip.ZipInputStream.readFully(ZipInputStream.java:424)
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:277)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121)
at org.fedoraproject.xmvn.tools.install.impl.JarUtils.usesNativeCode(JarUtils.java:84)
at org.fedoraproject.xmvn.tools.install.impl.DefaultInstaller.installArtifact(DefaultInstaller.java:286)
at org.fedoraproject.xmvn.tools.install.impl.DefaultInstaller.install(DefaultInstaller.java:392)
... 2 more
.xmvn-reactor file contains:
<?xml version="1.0" encoding="US-ASCII"?>
<!-- Reactor installation plan generated by XMvn -->
<reactorInstallationPlan>
<artifact>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-downloader</artifactId>
<version>1.1</version>
<file>/builddir/build/BUILD/maven-downloader-1.1/target/classes</file>
<stereotype>jar</stereotype>
</artifact>
...
$ rpm -q xmvn
xmvn-2.0.0-0.168.git95bc9a3.noarch
Unfortunately the workaround of removing the classifier config eventually breaks the sqoop build I'm working on. Fix and unit test commited upstream. Fix: https://github.com/mizdebsk/xmvn/commit/c89394ded6f51aa53a1490cfba75084ad9927ed1 Test: https://github.com/mizdebsk/xmvn/commit/ea5bb3291632df508c1ada40d31fd9c48d2ee569 Verified upstream. Without the fix: Running org.fedoraproject.xmvn.mojo.DirectoryInstallationTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.229 sec <<< FAILURE! - in org.fedoraproject.xmvn.mojo.DirectoryInstallationTest testDirectoryAsProjectFile(org.fedoraproject.xmvn.mojo.DirectoryInstallationTest) Time elapsed: 0.149 sec <<< FAILURE! java.lang.AssertionError: Unexpected method call Deployer.deploy(org.fedoraproject.xmvn.deployer.DeploymentRequest@ac12c78e): Deployer.deploy(isA(org.fedoraproject.xmvn.deployer.DeploymentRequest)): expected: 1, actual: 2 at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44) at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:94) at com.sun.proxy.$Proxy10.deploy(Unknown Source) at org.fedoraproject.xmvn.mojo.InstallMojo.deployArtifact(InstallMojo.java:153) at org.fedoraproject.xmvn.mojo.InstallMojo.execute(InstallMojo.java:185) at org.fedoraproject.xmvn.mojo.DirectoryInstallationTest.testDirectoryAsProjectFile(DirectoryInstallationTest.java:100) With the fix: Running org.fedoraproject.xmvn.mojo.DirectoryInstallationTest [main] INFO org.fedoraproject.xmvn.mojo.InstallMojo - Skipping installation of artifact /tmp/xmvn-test6026120378042784621: artifact file is not a regular file Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.189 sec - in org.fedoraproject.xmvn.mojo.DirectoryInstallationTest Artifact file which is a directory is skipped with a message printed. Fixed in xmvn-1.5.0-0.23.gitcb3a0a6 Fixed in xmvn-1.5.0-0.24.gitcb3a0a6 I believe that this bug is fixed in xmvn-1.5.0-0.24.gitcb3a0a6, which is available in Fedora Rawhide, so I am closing this bug now. The build containing the fix can be found at Koji: http://koji.fedoraproject.org/koji/buildinfo?buildID=507521 |
Created attachment 876929 [details] effective pom generated from mvn help:effective-pom -f <path-to-pom> A maven-jar-plugin configuration that includes a classifier like this: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration> <classifier>hadoop${hadoop.profile}</classifier> </configuration> </plugin> leads to a bad file entry being generated in the .xmvn-reactor file: <artifact> <groupId>org.apache.sqoop</groupId> <artifactId>execution</artifactId> <extension>pom</extension> <version>1.99.3</version> <rawPomPath>/home/pmackinn/rpmbuild/BUILD/sqoop-1.99.3/execution/pom.xml</rawPomPath> <effectivePomPath>/tmp/xmvn6133786444662127620.pom.xml</effectivePomPath> </artifact> <artifact> <groupId>org.apache.sqoop.execution</groupId> <artifactId>sqoop-execution-mapreduce</artifactId> <version>1.99.3</version> <file>/home/pmackinn/rpmbuild/BUILD/sqoop-1.99.3/execution/mapreduce/target/classes</file> <rawPomPath>/home/pmackinn/rpmbuild/BUILD/sqoop-1.99.3/execution/mapreduce/pom.xml</rawPomPath> <effectivePomPath>/tmp/xmvn6994462136357679764.pom.xml</effectivePomPath> </artifact> <artifact> <groupId>org.apache.sqoop.execution</groupId> <artifactId>sqoop-execution-mapreduce</artifactId> <classifier>hadoop200</classifier> <version>1.99.3</version> <file>/home/pmackinn/rpmbuild/BUILD/sqoop-1.99.3/execution/mapreduce/target/sqoop-execution-mapreduce-1.99.3-hadoop200.jar</file> </artifact>