diff --git a/SOURCES/0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch b/SOURCES/0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch index cd0c482..7f0911f 100644 --- a/SOURCES/0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch +++ b/SOURCES/0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch @@ -1,64 +1,60 @@ -From d2518d3e3f9d81fdb3852c354358cb965b9a9693 Mon Sep 17 00:00:00 2001 +From cbab5ce8303f9c223a04c1ea232e3c81da642663 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski -Date: Thu, 3 Oct 2013 16:12:13 +0200 -Subject: [PATCH] Port to Maven 3.0.5 and Sonatype Aether +Date: Thu, 19 Dec 2013 13:59:27 +0100 +Subject: [PATCH 1/4] Port to Maven 3.0.5 and Sonatype Aether +[backport-feature-maven-3.0.5] --- - xmvn-connector/pom.xml | 6 +- - .../connector/FedoraPluginVersionResolver.java | 6 +- - .../maven/connector/FedoraWorkspaceReader.java | 6 +- - xmvn-core/pom.xml | 18 ++- - .../dependency/DependencyExtractionResult.java | 2 +- - .../dependency/impl/BuildDependencyVisitor.java | 4 +- - .../impl/DefaultDependencyExtractionResult.java | 2 +- - .../maven/installer/InstallationRequest.java | 2 +- - .../maven/installer/impl/DefaultInstaller.java | 14 +- - .../maven/installer/impl/FragmentFile.java | 2 +- - .../maven/installer/impl/Package.java | 4 +- - .../maven/model/impl/IvyModelReader.java | 160 --------------------- - .../fedoraproject/maven/repository/Repository.java | 2 +- - .../maven/repository/impl/AbstractRepository.java | 2 +- - .../maven/repository/impl/CompoundRepository.java | 2 +- - .../maven/repository/impl/SimpleRepository.java | 2 +- - .../maven/resolver/ArtifactBlacklist.java | 2 +- - .../maven/resolver/DependencyMap.java | 2 +- - .../maven/resolver/ResolutionRequest.java | 4 +- - .../org/fedoraproject/maven/resolver/Resolver.java | 2 +- - .../resolver/impl/DefaultArtifactBlacklist.java | 4 +- - .../maven/resolver/impl/DefaultDependencyMap.java | 4 +- - .../maven/resolver/impl/DefaultResolver.java | 4 +- - .../maven/resolver/impl/DepmapReader.java | 4 +- - .../fedoraproject/maven/utils/ArtifactUtils.java | 8 +- - .../maven/dependency/AbstractDependencyTest.java | 4 +- - .../maven/installer/AbstractInstallerTest.java | 4 +- - .../maven/installer/BasicIvyInstallerTest.java | 80 ----------- - .../maven/installer/IvyInstallerExclusionTest.java | 87 ----------- - .../maven/repository/FlatRepositoryTest.java | 4 +- - .../maven/repository/JppRepositoryTest.java | 4 +- - .../fedoraproject/maven/repository/LayoutTest.java | 4 +- - .../maven/repository/MavenRepositoryTest.java | 4 +- - .../maven/repository/MyRepository.java | 2 +- - .../maven/repository/NestedRepositoriesTest.java | 4 +- - .../fedoraproject/maven/resolver/DepmapTest.java | 4 +- - xmvn-mojo/pom.xml | 10 +- - .../maven/rpminstall/plugin/BuilddepMojo.java | 2 +- - .../maven/rpminstall/plugin/InstallMojo.java | 4 +- - .../maven/rpminstall/plugin/Utils.java | 4 +- - xmvn-parent/pom.xml | 30 ++-- - xmvn-tools/pom.xml | 4 +- - xmvn-tools/xmvn-install/pom.xml | 6 +- - .../maven/tools/installer/InstallerCli.java | 4 +- - xmvn-tools/xmvn-resolve/pom.xml | 6 +- - .../maven/tools/resolver/ResolverCli.java | 4 +- - xmvn-tools/xmvn-subst/pom.xml | 6 +- - .../maven/tools/subst/ArtifactVisitor.java | 4 +- - 48 files changed, 130 insertions(+), 423 deletions(-) - delete mode 100644 xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java - delete mode 100644 xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java - delete mode 100644 xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java + xmvn-connector/pom.xml | 2 +- + .../maven/connector/FedoraPluginVersionResolver.java | 6 +++--- + .../fedoraproject/maven/connector/FedoraWorkspaceReader.java | 6 +++--- + xmvn-core/pom.xml | 6 +++++- + .../maven/dependency/DependencyExtractionResult.java | 2 +- + .../maven/dependency/impl/BuildDependencyVisitor.java | 4 ++-- + .../dependency/impl/DefaultDependencyExtractionResult.java | 2 +- + .../fedoraproject/maven/installer/InstallationRequest.java | 2 +- + .../fedoraproject/maven/installer/impl/DefaultInstaller.java | 4 ++-- + .../org/fedoraproject/maven/installer/impl/FragmentFile.java | 2 +- + .../java/org/fedoraproject/maven/installer/impl/Package.java | 4 ++-- + .../java/org/fedoraproject/maven/repository/Repository.java | 2 +- + .../maven/repository/impl/AbstractRepository.java | 2 +- + .../maven/repository/impl/CompoundRepository.java | 2 +- + .../fedoraproject/maven/repository/impl/SimpleRepository.java | 2 +- + .../org/fedoraproject/maven/resolver/ArtifactBlacklist.java | 2 +- + .../java/org/fedoraproject/maven/resolver/DependencyMap.java | 2 +- + .../org/fedoraproject/maven/resolver/ResolutionRequest.java | 4 ++-- + .../main/java/org/fedoraproject/maven/resolver/Resolver.java | 2 +- + .../maven/resolver/impl/DefaultArtifactBlacklist.java | 4 ++-- + .../maven/resolver/impl/DefaultDependencyMap.java | 4 ++-- + .../fedoraproject/maven/resolver/impl/DefaultResolver.java | 4 ++-- + .../org/fedoraproject/maven/resolver/impl/DepmapReader.java | 4 ++-- + .../java/org/fedoraproject/maven/utils/ArtifactUtils.java | 8 ++++---- + .../maven/dependency/AbstractDependencyTest.java | 4 ++-- + .../fedoraproject/maven/installer/AbstractInstallerTest.java | 4 ++-- + .../fedoraproject/maven/installer/BasicIvyInstallerTest.java | 4 ++-- + .../maven/installer/IvyInstallerExclusionTest.java | 4 ++-- + .../fedoraproject/maven/repository/FlatRepositoryTest.java | 4 ++-- + .../org/fedoraproject/maven/repository/JppRepositoryTest.java | 4 ++-- + .../java/org/fedoraproject/maven/repository/LayoutTest.java | 4 ++-- + .../fedoraproject/maven/repository/MavenRepositoryTest.java | 4 ++-- + .../java/org/fedoraproject/maven/repository/MyRepository.java | 2 +- + .../maven/repository/NestedRepositoriesTest.java | 4 ++-- + .../java/org/fedoraproject/maven/resolver/DepmapTest.java | 4 ++-- + xmvn-mojo/pom.xml | 6 +++++- + .../fedoraproject/maven/rpminstall/plugin/BuilddepMojo.java | 2 +- + .../fedoraproject/maven/rpminstall/plugin/InstallMojo.java | 4 ++-- + .../java/org/fedoraproject/maven/rpminstall/plugin/Utils.java | 4 ++-- + xmvn-parent/pom.xml | 11 ++++++++--- + xmvn-tools/xmvn-install/pom.xml | 6 +++++- + .../org/fedoraproject/maven/tools/installer/InstallerCli.java | 4 ++-- + xmvn-tools/xmvn-resolve/pom.xml | 6 +++++- + .../org/fedoraproject/maven/tools/resolver/ResolverCli.java | 4 ++-- + xmvn-tools/xmvn-subst/pom.xml | 6 +++++- + .../org/fedoraproject/maven/tools/subst/ArtifactVisitor.java | 4 ++-- + 46 files changed, 103 insertions(+), 78 deletions(-) diff --git a/xmvn-connector/pom.xml b/xmvn-connector/pom.xml -index 19d0125..769fd0a 100644 +index 19d0125..8b50535 100644 --- a/xmvn-connector/pom.xml +++ b/xmvn-connector/pom.xml @@ -56,7 +56,7 @@ @@ -70,17 +66,6 @@ index 19d0125..769fd0a 100644 aether-api -@@ -72,8 +72,8 @@ - xmvn-core - - -- org.eclipse.sisu -- org.eclipse.sisu.plexus -+ org.sonatype.sisu -+ sisu-inject-plexus - - - diff --git a/xmvn-connector/src/main/java/org/fedoraproject/maven/connector/FedoraPluginVersionResolver.java b/xmvn-connector/src/main/java/org/fedoraproject/maven/connector/FedoraPluginVersionResolver.java index f2ef618..2c5f3ff 100644 --- a/xmvn-connector/src/main/java/org/fedoraproject/maven/connector/FedoraPluginVersionResolver.java @@ -121,7 +106,7 @@ index 09499ed..cb05729 100644 /** * @author Mikolaj Izdebski diff --git a/xmvn-core/pom.xml b/xmvn-core/pom.xml -index 79a8320..4bbe6c0 100644 +index 79a8320..f7b9db3 100644 --- a/xmvn-core/pom.xml +++ b/xmvn-core/pom.xml @@ -34,10 +34,14 @@ @@ -140,31 +125,6 @@ index 79a8320..4bbe6c0 100644 org.apache.maven maven-model -@@ -46,16 +50,20 @@ - plexus-component-annotations - - -- org.eclipse.sisu -- org.eclipse.sisu.plexus -+ org.sonatype.sisu -+ sisu-inject-plexus - - - org.codehaus.plexus - plexus-utils - - -- org.apache.ivy -- ivy -+ asm -+ asm -+ -+ -+ asm -+ asm-commons - - - diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/DependencyExtractionResult.java b/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/DependencyExtractionResult.java index 2c59307..2519655 100644 --- a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/DependencyExtractionResult.java @@ -223,44 +183,27 @@ index 7033704..0f4bfc3 100644 /** * @author Mikolaj Izdebski diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java -index e1e354d..e22905f 100644 +index e1e354d..3817c7b 100644 --- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java +++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java -@@ -48,12 +48,6 @@ import org.codehaus.plexus.component.annotations.Component; +@@ -48,8 +48,6 @@ import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.artifact.DefaultArtifact; --import org.eclipse.sisu.space.asm.ClassReader; --import org.eclipse.sisu.space.asm.ClassVisitor; --import org.eclipse.sisu.space.asm.MethodVisitor; --import org.eclipse.sisu.space.asm.Opcodes; - import org.fedoraproject.maven.config.Configuration; - import org.fedoraproject.maven.config.Configurator; - import org.fedoraproject.maven.config.InstallerSettings; -@@ -75,6 +69,12 @@ import org.fedoraproject.maven.resolver.ResolutionResult; + import org.eclipse.sisu.space.asm.ClassReader; + import org.eclipse.sisu.space.asm.ClassVisitor; + import org.eclipse.sisu.space.asm.MethodVisitor; +@@ -75,6 +73,8 @@ import org.fedoraproject.maven.resolver.ResolutionResult; import org.fedoraproject.maven.resolver.Resolver; import org.fedoraproject.maven.utils.ArtifactUtils; import org.fedoraproject.maven.utils.LoggingUtils; -+import org.objectweb.asm.ClassReader; -+import org.objectweb.asm.MethodVisitor; -+import org.objectweb.asm.Opcodes; -+import org.objectweb.asm.commons.EmptyVisitor; +import org.sonatype.aether.artifact.Artifact; +import org.sonatype.aether.util.artifact.DefaultArtifact; /** * WARNING: This class is part of internal implementation of XMvn and it is marked as public only for -@@ -517,7 +517,7 @@ public class DefaultInstaller - - final boolean[] usesNativeCode = new boolean[1]; - -- new ClassReader( jis ).accept( new ClassVisitor( Opcodes.ASM4 ) -+ new ClassReader( jis ).accept( new EmptyVisitor() - { - @Override - public MethodVisitor visitMethod( int flags, String name, String desc, String sig, String[] exc ) diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/FragmentFile.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/FragmentFile.java index 61e52dd..26199f8 100644 --- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/FragmentFile.java @@ -295,172 +238,6 @@ index 3c8b2b2..104c53d 100644 /** * @author Mikolaj Izdebski -diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java b/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java -deleted file mode 100644 -index 1bd7aea..0000000 ---- a/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java -+++ /dev/null -@@ -1,160 +0,0 @@ --/*- -- * Copyright (c) 2013 Red Hat, Inc. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package org.fedoraproject.maven.model.impl; -- --import java.io.IOException; --import java.net.MalformedURLException; --import java.nio.file.Path; --import java.text.ParseException; --import java.util.ArrayList; --import java.util.Arrays; --import java.util.Collections; --import java.util.HashSet; --import java.util.LinkedHashMap; --import java.util.List; --import java.util.Map; --import java.util.Map.Entry; --import java.util.Set; -- --import org.apache.ivy.core.module.descriptor.Artifact; --import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor; --import org.apache.ivy.core.module.descriptor.DependencyDescriptor; --import org.apache.ivy.core.module.descriptor.ExcludeRule; --import org.apache.ivy.core.module.descriptor.ModuleDescriptor; --import org.apache.ivy.core.module.id.ModuleId; --import org.apache.ivy.core.module.id.ModuleRevisionId; --import org.apache.ivy.core.settings.IvySettings; --import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser; --import org.apache.maven.model.Dependency; --import org.apache.maven.model.Exclusion; --import org.apache.maven.model.Model; --import org.codehaus.plexus.component.annotations.Component; --import org.codehaus.plexus.util.StringUtils; --import org.fedoraproject.maven.model.ModelFormatException; --import org.fedoraproject.maven.model.ModelReader; -- --/** -- * WARNING: This class is part of internal implementation of XMvn and it is marked as public only for -- * technical reasons. This class is not part of XMvn API. Client code using XMvn should not reference -- * it directly. -- * -- * @author Mikolaj Izdebski -- */ --@Component( role = ModelReader.class, hint = "ivy", instantiationStrategy = "singleton" ) --public class IvyModelReader -- implements ModelReader --{ -- private static final List MAVEN_SCOPES = Arrays.asList( "compile", "runtime", "provided", "test", "system" ); -- -- private ModuleDescriptor readModule( Path modulePath ) -- throws IOException, ParseException -- { -- try -- { -- XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance(); -- IvySettings settings = new IvySettings(); -- return parser.parseDescriptor( settings, modulePath.toUri().toURL(), false ); -- } -- catch ( MalformedURLException e ) -- { -- throw new RuntimeException( e ); -- } -- } -- -- private String nullify( String value, String defaultValue ) -- { -- if ( StringUtils.isEmpty( value ) || value.equals( defaultValue ) ) -- return null; -- -- return value; -- } -- -- private Model getModuleModel( ModuleDescriptor module ) -- { -- Model model = new Model(); -- model.setModelVersion( "4.0.0" ); -- -- ModuleRevisionId moduleRevision = module.getModuleRevisionId(); -- model.setGroupId( moduleRevision.getOrganisation() ); -- model.setArtifactId( moduleRevision.getName() ); -- model.setVersion( moduleRevision.getRevision() ); -- -- model.setPackaging( "pom" ); -- for ( Artifact artifact : module.getAllArtifacts() ) -- if ( artifact.getName().equals( moduleRevision.getName() ) && artifact.getAttribute( "classifier" ) == null ) -- model.setPackaging( artifact.getType() ); -- -- for ( DependencyDescriptor dependencyModule : module.getDependencies() ) -- { -- Set scopes = new HashSet<>( MAVEN_SCOPES ); -- scopes.retainAll( Arrays.asList( dependencyModule.getModuleConfigurations() ) ); -- String scope = scopes.isEmpty() ? null : scopes.iterator().next(); -- -- Map map = new LinkedHashMap<>(); -- for ( DependencyArtifactDescriptor dependencyArtifact : dependencyModule.getAllDependencyArtifacts() ) -- { -- String classifier = dependencyArtifact.getExtraAttribute( "classifier" ); -- String type = dependencyArtifact.getType(); -- map.put( classifier, type ); -- } -- if ( map.isEmpty() ) -- map = Collections.singletonMap( null, null ); -- -- List exclusions = new ArrayList<>(); -- for ( ExcludeRule rule : dependencyModule.getAllExcludeRules() ) -- { -- Exclusion exclusion = new Exclusion(); -- exclusions.add( exclusion ); -- -- ModuleId exclusedModule = rule.getId().getModuleId(); -- exclusion.setGroupId( exclusedModule.getOrganisation() ); -- exclusion.setArtifactId( exclusedModule.getName() ); -- } -- -- for ( Entry entry : map.entrySet() ) -- { -- Dependency dependency = new Dependency(); -- model.addDependency( dependency ); -- -- ModuleRevisionId dependencyRevision = dependencyModule.getDependencyRevisionId(); -- dependency.setGroupId( dependencyRevision.getOrganisation() ); -- dependency.setArtifactId( dependencyRevision.getName() ); -- dependency.setVersion( nullify( dependencyRevision.getRevision(), "SYSTEM" ) ); -- dependency.setType( nullify( entry.getValue(), "jar" ) ); -- dependency.setClassifier( nullify( entry.getKey(), "" ) ); -- dependency.setScope( nullify( scope, "compile" ) ); -- dependency.setExclusions( new ArrayList<>( exclusions ) ); -- } -- } -- -- return model; -- } -- -- @Override -- public Model readModel( Path modelPath ) -- throws IOException, ModelFormatException -- { -- try -- { -- ModuleDescriptor module = readModule( modelPath ); -- return getModuleModel( module ); -- } -- catch ( ParseException e ) -- { -- throw new ModelFormatException( "Unable to parse Ivy module", e ); -- } -- } --} diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/repository/Repository.java b/xmvn-core/src/main/java/org/fedoraproject/maven/repository/Repository.java index 7199173..c1c597b 100644 --- a/xmvn-core/src/main/java/org/fedoraproject/maven/repository/Repository.java @@ -708,184 +485,37 @@ index ba98524..653619f 100644 /** * @author Mikolaj Izdebski diff --git a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java -deleted file mode 100644 -index 4af3ffb..0000000 +index 4af3ffb..cfbe2b2 100644 --- a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java -+++ /dev/null -@@ -1,80 +0,0 @@ --/*- -- * Copyright (c) 2013 Red Hat, Inc. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package org.fedoraproject.maven.installer; -- --import static org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace; -- --import java.nio.file.Files; --import java.nio.file.Path; --import java.nio.file.Paths; -- ++++ b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java +@@ -21,9 +21,9 @@ import java.nio.file.Files; + import java.nio.file.Path; + import java.nio.file.Paths; + -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.artifact.DefaultArtifact; --import org.fedoraproject.maven.utils.ArtifactUtils; -- --/** -- * @author Mikolaj Izdebski -- */ --public class BasicIvyInstallerTest -- extends AbstractInstallerTest --{ -- /** -- * Test installation of Ivy modules. -- * -- * @throws Exception -- */ -- public void testComponentLookup() -- throws Exception -- { -- Path artifactPath = Paths.get( "src/test/resources/jar/empty.jar" ); -- Path modelPath = Paths.get( "src/test/resources/ivy/simple.ivy" ); -- -- Artifact artifact = new DefaultArtifact( "org.apache", "hello-ivy", "jar", "1.2.3" ); -- artifact = artifact.setFile( artifactPath.toFile() ); -- artifact = ArtifactUtils.setRawModelPath( artifact, modelPath ); -- artifact = ArtifactUtils.setEffectiveModelPath( artifact, modelPath ); -- -- request.addArtifact( artifact ); -- -- logger.info( "Added arrifact " + artifact ); -- logger.info( " POM path: " + modelPath.toAbsolutePath() ); -- logger.info( " JAR path: " + artifactPath.toAbsolutePath() ); -- -- performInstallation(); -- -- setIgnoreWhitespace( true ); -- -- assertTrue( Files.isRegularFile( installRoot.resolve( "repo/jar/hello-ivy.jar" ) ) ); -- assertXmlEqual( "ivy/simple.ivy", "repo/raw-pom/JPP-hello-ivy.pom" ); -- assertXmlEqual( "ivy/simple.pom", "repo/effective-pom/JPP-hello-ivy.pom" ); -- -- StringBuilder depmap = new StringBuilder(); -- depmap.append( "" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " org.apache" ); -- depmap.append( " hello-ivy" ); -- depmap.append( " 1.2.3" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " JPP" ); -- depmap.append( " hello-ivy" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( "" ); -- assertXmlEqual( depmap, "depmaps/package.xml" ); -- } --} + import org.fedoraproject.maven.utils.ArtifactUtils; ++import org.sonatype.aether.artifact.Artifact; ++import org.sonatype.aether.util.artifact.DefaultArtifact; + + /** + * @author Mikolaj Izdebski diff --git a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java -deleted file mode 100644 -index 8ae7564..0000000 +index 8ae7564..ce7ccc8 100644 --- a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java -+++ /dev/null -@@ -1,87 +0,0 @@ --/*- -- * Copyright (c) 2013 Red Hat, Inc. -- * -- * Licensed under the Apache License, Version 2.0 (the "License"); -- * you may not use this file except in compliance with the License. -- * You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, software -- * distributed under the License is distributed on an "AS IS" BASIS, -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- * See the License for the specific language governing permissions and -- * limitations under the License. -- */ --package org.fedoraproject.maven.installer; -- --import static org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace; -- --import java.nio.file.Files; --import java.nio.file.Path; --import java.nio.file.Paths; -- ++++ b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java +@@ -21,9 +21,9 @@ import java.nio.file.Files; + import java.nio.file.Path; + import java.nio.file.Paths; + -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.artifact.DefaultArtifact; --import org.fedoraproject.maven.utils.ArtifactUtils; -- --/** -- * @author Mikolaj Izdebski -- */ --public class IvyInstallerExclusionTest -- extends AbstractInstallerTest --{ -- /** -- * Test installation of Ivy modules. -- * -- * @throws Exception -- */ -- public void testComponentLookup() -- throws Exception -- { -- Path artifactPath = Paths.get( "src/test/resources/jar/empty.jar" ); -- Path modelPath = Paths.get( "src/test/resources/ivy/dependency-exclusion.ivy" ); -- -- Artifact artifact = new DefaultArtifact( "org.apache", "hello-ivy", "jar", "1.2.3" ); -- artifact = artifact.setFile( artifactPath.toFile() ); -- artifact = ArtifactUtils.setRawModelPath( artifact, modelPath ); -- artifact = ArtifactUtils.setEffectiveModelPath( artifact, modelPath ); -- -- request.addArtifact( artifact ); -- -- logger.info( "Added arrifact " + artifact ); -- logger.info( " POM path: " + modelPath.toAbsolutePath() ); -- logger.info( " JAR path: " + artifactPath.toAbsolutePath() ); -- -- performInstallation(); -- -- setIgnoreWhitespace( true ); -- -- assertTrue( Files.isRegularFile( installRoot.resolve( "repo/jar/hello-ivy.jar" ) ) ); -- assertXmlEqual( "ivy/dependency-exclusion.ivy", "repo/raw-pom/JPP-hello-ivy.pom" ); -- assertXmlEqual( "ivy/dependency-exclusion.pom", "repo/effective-pom/JPP-hello-ivy.pom" ); -- -- StringBuilder depmap = new StringBuilder(); -- depmap.append( "" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " org.apache" ); -- depmap.append( " hello-ivy" ); -- depmap.append( " 1.2.3" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " JPP" ); -- depmap.append( " hello-ivy" ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " " ); -- depmap.append( " UNKNOWN" ); -- depmap.append( " junit" ); -- depmap.append( " junit" ); -- depmap.append( " UNKNOWN" ); -- depmap.append( " " ); -- -- depmap.append( "" ); -- assertXmlEqual( depmap, "depmaps/package.xml" ); -- } --} + import org.fedoraproject.maven.utils.ArtifactUtils; ++import org.sonatype.aether.artifact.Artifact; ++import org.sonatype.aether.util.artifact.DefaultArtifact; + + /** + * @author Mikolaj Izdebski diff --git a/xmvn-core/src/test/java/org/fedoraproject/maven/repository/FlatRepositoryTest.java b/xmvn-core/src/test/java/org/fedoraproject/maven/repository/FlatRepositoryTest.java index 564a7b7..c32fba2 100644 --- a/xmvn-core/src/test/java/org/fedoraproject/maven/repository/FlatRepositoryTest.java @@ -1010,17 +640,11 @@ index 04ea28b..f5012d3 100644 /** * @author Mikolaj Izdebski diff --git a/xmvn-mojo/pom.xml b/xmvn-mojo/pom.xml -index f87c53f..9b9ae1f 100644 +index f87c53f..14505d2 100644 --- a/xmvn-mojo/pom.xml +++ b/xmvn-mojo/pom.xml -@@ -68,13 +68,17 @@ - plexus-component-annotations - - -- org.eclipse.sisu -- org.eclipse.sisu.plexus -+ org.sonatype.sisu -+ sisu-inject-plexus +@@ -72,9 +72,13 @@ + org.eclipse.sisu.plexus - org.eclipse.aether @@ -1087,17 +711,16 @@ index b6aa8c8..2419177 100644 /** * @author Mikolaj Izdebski diff --git a/xmvn-parent/pom.xml b/xmvn-parent/pom.xml -index a0aef7f..76894d2 100644 +index a0aef7f..9b3030b 100644 --- a/xmvn-parent/pom.xml +++ b/xmvn-parent/pom.xml -@@ -74,15 +74,15 @@ +@@ -74,11 +74,11 @@ US-ASCII - 0.9.0.M3 -- 2.3.0 + 1.13.1 -+ 3.3.1 + 2.3.0 1.32 2.1.1 - 3.1.1 @@ -1105,11 +728,6 @@ index a0aef7f..76894d2 100644 3.0.15 1.5.5 3.2 -- 0.0.0.M5 -+ 2.3.0 - - - 1.3.2.GA @@ -136,11 +136,16 @@ ${mavenVersion} @@ -1128,50 +746,6 @@ index a0aef7f..76894d2 100644 org.apache.maven.plugin-tools maven-plugin-annotations ${pluginToolsVersion} -@@ -151,8 +156,8 @@ - ${plexusVersion} - - -- org.eclipse.sisu -- org.eclipse.sisu.plexus -+ org.sonatype.sisu -+ sisu-inject-plexus - ${sisuVersion} - - -@@ -191,9 +196,14 @@ - ${mavenInvokerVersion} - - -- org.apache.ivy -- ivy -- ${ivyVersion} -+ asm -+ asm -+ ${asmVersion} -+ -+ -+ asm -+ asm-commons -+ ${asmVersion} - - - -diff --git a/xmvn-tools/pom.xml b/xmvn-tools/pom.xml -index e1b21a3..8f68dfe 100644 ---- a/xmvn-tools/pom.xml -+++ b/xmvn-tools/pom.xml -@@ -48,8 +48,8 @@ - xmvn-core - - -- org.eclipse.sisu -- org.eclipse.sisu.plexus -+ org.sonatype.sisu -+ sisu-inject-plexus - - - diff --git a/xmvn-tools/xmvn-install/pom.xml b/xmvn-tools/xmvn-install/pom.xml index e117776..da1bb43 100644 --- a/xmvn-tools/xmvn-install/pom.xml @@ -1287,5 +861,5 @@ index 5755401..86d2d60 100644 @Component( role = ArtifactVisitor.class ) public class ArtifactVisitor -- -1.8.1.4 +1.8.4.2 diff --git a/SOURCES/0002-Remove-integration-with-for-Apache-Ivy.patch b/SOURCES/0002-Remove-integration-with-for-Apache-Ivy.patch new file mode 100644 index 0000000..51d304a --- /dev/null +++ b/SOURCES/0002-Remove-integration-with-for-Apache-Ivy.patch @@ -0,0 +1,404 @@ +From 9bfc58f2c4f0e039ea7f776ae859976cd85fbbaf Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Thu, 19 Dec 2013 14:41:05 +0100 +Subject: [PATCH 2/4] Remove integration with for Apache Ivy + +[backport-feature-remove-ivy-support] +--- + xmvn-core/pom.xml | 4 - + .../maven/model/impl/IvyModelReader.java | 160 --------------------- + .../maven/installer/BasicIvyInstallerTest.java | 80 ----------- + .../maven/installer/IvyInstallerExclusionTest.java | 87 ----------- + xmvn-parent/pom.xml | 6 - + 5 files changed, 337 deletions(-) + delete mode 100644 xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java + delete mode 100644 xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java + delete mode 100644 xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java + +diff --git a/xmvn-core/pom.xml b/xmvn-core/pom.xml +index f7b9db3..79238cd 100644 +--- a/xmvn-core/pom.xml ++++ b/xmvn-core/pom.xml +@@ -57,10 +57,6 @@ + org.codehaus.plexus + plexus-utils + +- +- org.apache.ivy +- ivy +- + + + +diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java b/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java +deleted file mode 100644 +index 1bd7aea..0000000 +--- a/xmvn-core/src/main/java/org/fedoraproject/maven/model/impl/IvyModelReader.java ++++ /dev/null +@@ -1,160 +0,0 @@ +-/*- +- * Copyright (c) 2013 Red Hat, Inc. +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +-package org.fedoraproject.maven.model.impl; +- +-import java.io.IOException; +-import java.net.MalformedURLException; +-import java.nio.file.Path; +-import java.text.ParseException; +-import java.util.ArrayList; +-import java.util.Arrays; +-import java.util.Collections; +-import java.util.HashSet; +-import java.util.LinkedHashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Map.Entry; +-import java.util.Set; +- +-import org.apache.ivy.core.module.descriptor.Artifact; +-import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor; +-import org.apache.ivy.core.module.descriptor.DependencyDescriptor; +-import org.apache.ivy.core.module.descriptor.ExcludeRule; +-import org.apache.ivy.core.module.descriptor.ModuleDescriptor; +-import org.apache.ivy.core.module.id.ModuleId; +-import org.apache.ivy.core.module.id.ModuleRevisionId; +-import org.apache.ivy.core.settings.IvySettings; +-import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser; +-import org.apache.maven.model.Dependency; +-import org.apache.maven.model.Exclusion; +-import org.apache.maven.model.Model; +-import org.codehaus.plexus.component.annotations.Component; +-import org.codehaus.plexus.util.StringUtils; +-import org.fedoraproject.maven.model.ModelFormatException; +-import org.fedoraproject.maven.model.ModelReader; +- +-/** +- * WARNING: This class is part of internal implementation of XMvn and it is marked as public only for +- * technical reasons. This class is not part of XMvn API. Client code using XMvn should not reference +- * it directly. +- * +- * @author Mikolaj Izdebski +- */ +-@Component( role = ModelReader.class, hint = "ivy", instantiationStrategy = "singleton" ) +-public class IvyModelReader +- implements ModelReader +-{ +- private static final List MAVEN_SCOPES = Arrays.asList( "compile", "runtime", "provided", "test", "system" ); +- +- private ModuleDescriptor readModule( Path modulePath ) +- throws IOException, ParseException +- { +- try +- { +- XmlModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance(); +- IvySettings settings = new IvySettings(); +- return parser.parseDescriptor( settings, modulePath.toUri().toURL(), false ); +- } +- catch ( MalformedURLException e ) +- { +- throw new RuntimeException( e ); +- } +- } +- +- private String nullify( String value, String defaultValue ) +- { +- if ( StringUtils.isEmpty( value ) || value.equals( defaultValue ) ) +- return null; +- +- return value; +- } +- +- private Model getModuleModel( ModuleDescriptor module ) +- { +- Model model = new Model(); +- model.setModelVersion( "4.0.0" ); +- +- ModuleRevisionId moduleRevision = module.getModuleRevisionId(); +- model.setGroupId( moduleRevision.getOrganisation() ); +- model.setArtifactId( moduleRevision.getName() ); +- model.setVersion( moduleRevision.getRevision() ); +- +- model.setPackaging( "pom" ); +- for ( Artifact artifact : module.getAllArtifacts() ) +- if ( artifact.getName().equals( moduleRevision.getName() ) && artifact.getAttribute( "classifier" ) == null ) +- model.setPackaging( artifact.getType() ); +- +- for ( DependencyDescriptor dependencyModule : module.getDependencies() ) +- { +- Set scopes = new HashSet<>( MAVEN_SCOPES ); +- scopes.retainAll( Arrays.asList( dependencyModule.getModuleConfigurations() ) ); +- String scope = scopes.isEmpty() ? null : scopes.iterator().next(); +- +- Map map = new LinkedHashMap<>(); +- for ( DependencyArtifactDescriptor dependencyArtifact : dependencyModule.getAllDependencyArtifacts() ) +- { +- String classifier = dependencyArtifact.getExtraAttribute( "classifier" ); +- String type = dependencyArtifact.getType(); +- map.put( classifier, type ); +- } +- if ( map.isEmpty() ) +- map = Collections.singletonMap( null, null ); +- +- List exclusions = new ArrayList<>(); +- for ( ExcludeRule rule : dependencyModule.getAllExcludeRules() ) +- { +- Exclusion exclusion = new Exclusion(); +- exclusions.add( exclusion ); +- +- ModuleId exclusedModule = rule.getId().getModuleId(); +- exclusion.setGroupId( exclusedModule.getOrganisation() ); +- exclusion.setArtifactId( exclusedModule.getName() ); +- } +- +- for ( Entry entry : map.entrySet() ) +- { +- Dependency dependency = new Dependency(); +- model.addDependency( dependency ); +- +- ModuleRevisionId dependencyRevision = dependencyModule.getDependencyRevisionId(); +- dependency.setGroupId( dependencyRevision.getOrganisation() ); +- dependency.setArtifactId( dependencyRevision.getName() ); +- dependency.setVersion( nullify( dependencyRevision.getRevision(), "SYSTEM" ) ); +- dependency.setType( nullify( entry.getValue(), "jar" ) ); +- dependency.setClassifier( nullify( entry.getKey(), "" ) ); +- dependency.setScope( nullify( scope, "compile" ) ); +- dependency.setExclusions( new ArrayList<>( exclusions ) ); +- } +- } +- +- return model; +- } +- +- @Override +- public Model readModel( Path modelPath ) +- throws IOException, ModelFormatException +- { +- try +- { +- ModuleDescriptor module = readModule( modelPath ); +- return getModuleModel( module ); +- } +- catch ( ParseException e ) +- { +- throw new ModelFormatException( "Unable to parse Ivy module", e ); +- } +- } +-} +diff --git a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java +deleted file mode 100644 +index cfbe2b2..0000000 +--- a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/BasicIvyInstallerTest.java ++++ /dev/null +@@ -1,80 +0,0 @@ +-/*- +- * Copyright (c) 2013 Red Hat, Inc. +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +-package org.fedoraproject.maven.installer; +- +-import static org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace; +- +-import java.nio.file.Files; +-import java.nio.file.Path; +-import java.nio.file.Paths; +- +-import org.fedoraproject.maven.utils.ArtifactUtils; +-import org.sonatype.aether.artifact.Artifact; +-import org.sonatype.aether.util.artifact.DefaultArtifact; +- +-/** +- * @author Mikolaj Izdebski +- */ +-public class BasicIvyInstallerTest +- extends AbstractInstallerTest +-{ +- /** +- * Test installation of Ivy modules. +- * +- * @throws Exception +- */ +- public void testComponentLookup() +- throws Exception +- { +- Path artifactPath = Paths.get( "src/test/resources/jar/empty.jar" ); +- Path modelPath = Paths.get( "src/test/resources/ivy/simple.ivy" ); +- +- Artifact artifact = new DefaultArtifact( "org.apache", "hello-ivy", "jar", "1.2.3" ); +- artifact = artifact.setFile( artifactPath.toFile() ); +- artifact = ArtifactUtils.setRawModelPath( artifact, modelPath ); +- artifact = ArtifactUtils.setEffectiveModelPath( artifact, modelPath ); +- +- request.addArtifact( artifact ); +- +- logger.info( "Added arrifact " + artifact ); +- logger.info( " POM path: " + modelPath.toAbsolutePath() ); +- logger.info( " JAR path: " + artifactPath.toAbsolutePath() ); +- +- performInstallation(); +- +- setIgnoreWhitespace( true ); +- +- assertTrue( Files.isRegularFile( installRoot.resolve( "repo/jar/hello-ivy.jar" ) ) ); +- assertXmlEqual( "ivy/simple.ivy", "repo/raw-pom/JPP-hello-ivy.pom" ); +- assertXmlEqual( "ivy/simple.pom", "repo/effective-pom/JPP-hello-ivy.pom" ); +- +- StringBuilder depmap = new StringBuilder(); +- depmap.append( "" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " org.apache" ); +- depmap.append( " hello-ivy" ); +- depmap.append( " 1.2.3" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " JPP" ); +- depmap.append( " hello-ivy" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( "" ); +- assertXmlEqual( depmap, "depmaps/package.xml" ); +- } +-} +diff --git a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java b/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java +deleted file mode 100644 +index ce7ccc8..0000000 +--- a/xmvn-core/src/test/java/org/fedoraproject/maven/installer/IvyInstallerExclusionTest.java ++++ /dev/null +@@ -1,87 +0,0 @@ +-/*- +- * Copyright (c) 2013 Red Hat, Inc. +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +-package org.fedoraproject.maven.installer; +- +-import static org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace; +- +-import java.nio.file.Files; +-import java.nio.file.Path; +-import java.nio.file.Paths; +- +-import org.fedoraproject.maven.utils.ArtifactUtils; +-import org.sonatype.aether.artifact.Artifact; +-import org.sonatype.aether.util.artifact.DefaultArtifact; +- +-/** +- * @author Mikolaj Izdebski +- */ +-public class IvyInstallerExclusionTest +- extends AbstractInstallerTest +-{ +- /** +- * Test installation of Ivy modules. +- * +- * @throws Exception +- */ +- public void testComponentLookup() +- throws Exception +- { +- Path artifactPath = Paths.get( "src/test/resources/jar/empty.jar" ); +- Path modelPath = Paths.get( "src/test/resources/ivy/dependency-exclusion.ivy" ); +- +- Artifact artifact = new DefaultArtifact( "org.apache", "hello-ivy", "jar", "1.2.3" ); +- artifact = artifact.setFile( artifactPath.toFile() ); +- artifact = ArtifactUtils.setRawModelPath( artifact, modelPath ); +- artifact = ArtifactUtils.setEffectiveModelPath( artifact, modelPath ); +- +- request.addArtifact( artifact ); +- +- logger.info( "Added arrifact " + artifact ); +- logger.info( " POM path: " + modelPath.toAbsolutePath() ); +- logger.info( " JAR path: " + artifactPath.toAbsolutePath() ); +- +- performInstallation(); +- +- setIgnoreWhitespace( true ); +- +- assertTrue( Files.isRegularFile( installRoot.resolve( "repo/jar/hello-ivy.jar" ) ) ); +- assertXmlEqual( "ivy/dependency-exclusion.ivy", "repo/raw-pom/JPP-hello-ivy.pom" ); +- assertXmlEqual( "ivy/dependency-exclusion.pom", "repo/effective-pom/JPP-hello-ivy.pom" ); +- +- StringBuilder depmap = new StringBuilder(); +- depmap.append( "" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " org.apache" ); +- depmap.append( " hello-ivy" ); +- depmap.append( " 1.2.3" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " JPP" ); +- depmap.append( " hello-ivy" ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " " ); +- depmap.append( " UNKNOWN" ); +- depmap.append( " junit" ); +- depmap.append( " junit" ); +- depmap.append( " UNKNOWN" ); +- depmap.append( " " ); +- +- depmap.append( "" ); +- assertXmlEqual( depmap, "depmaps/package.xml" ); +- } +-} +diff --git a/xmvn-parent/pom.xml b/xmvn-parent/pom.xml +index 9b3030b..bfa4da6 100644 +--- a/xmvn-parent/pom.xml ++++ b/xmvn-parent/pom.xml +@@ -75,7 +75,6 @@ + US-ASCII + + 1.13.1 +- 2.3.0 + 1.32 + 2.1.1 + 3.0.5 +@@ -195,11 +194,6 @@ + maven-invoker + ${mavenInvokerVersion} + +- +- org.apache.ivy +- ivy +- ${ivyVersion} +- + + + +-- +1.8.4.2 + diff --git a/SOURCES/0003-Port-to-Sonatype-Sisu.patch b/SOURCES/0003-Port-to-Sonatype-Sisu.patch new file mode 100644 index 0000000..4cbe612 --- /dev/null +++ b/SOURCES/0003-Port-to-Sonatype-Sisu.patch @@ -0,0 +1,174 @@ +From 483dce9795e8a680651115bd7554a58d4fdd3d58 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Thu, 19 Dec 2013 14:58:25 +0100 +Subject: [PATCH 3/4] Port to Sonatype Sisu + +[backport-feature-sonatype-sisu] +--- + xmvn-connector/pom.xml | 4 ++-- + xmvn-core/pom.xml | 12 ++++++++++-- + .../maven/installer/impl/DefaultInstaller.java | 10 +++++----- + xmvn-mojo/pom.xml | 4 ++-- + xmvn-parent/pom.xml | 17 ++++++++++++++--- + xmvn-tools/pom.xml | 4 ++-- + 6 files changed, 35 insertions(+), 16 deletions(-) + +diff --git a/xmvn-connector/pom.xml b/xmvn-connector/pom.xml +index 8b50535..769fd0a 100644 +--- a/xmvn-connector/pom.xml ++++ b/xmvn-connector/pom.xml +@@ -72,8 +72,8 @@ + xmvn-core + + +- org.eclipse.sisu +- org.eclipse.sisu.plexus ++ org.sonatype.sisu ++ sisu-inject-plexus + + + +diff --git a/xmvn-core/pom.xml b/xmvn-core/pom.xml +index 79238cd..4bbe6c0 100644 +--- a/xmvn-core/pom.xml ++++ b/xmvn-core/pom.xml +@@ -50,13 +50,21 @@ + plexus-component-annotations + + +- org.eclipse.sisu +- org.eclipse.sisu.plexus ++ org.sonatype.sisu ++ sisu-inject-plexus + + + org.codehaus.plexus + plexus-utils + ++ ++ asm ++ asm ++ ++ ++ asm ++ asm-commons ++ + + + +diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java +index 3817c7b..e22905f 100644 +--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java ++++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java +@@ -48,10 +48,6 @@ import org.codehaus.plexus.component.annotations.Component; + import org.codehaus.plexus.component.annotations.Requirement; + import org.codehaus.plexus.logging.Logger; + import org.codehaus.plexus.util.StringUtils; +-import org.eclipse.sisu.space.asm.ClassReader; +-import org.eclipse.sisu.space.asm.ClassVisitor; +-import org.eclipse.sisu.space.asm.MethodVisitor; +-import org.eclipse.sisu.space.asm.Opcodes; + import org.fedoraproject.maven.config.Configuration; + import org.fedoraproject.maven.config.Configurator; + import org.fedoraproject.maven.config.InstallerSettings; +@@ -73,6 +69,10 @@ import org.fedoraproject.maven.resolver.ResolutionResult; + import org.fedoraproject.maven.resolver.Resolver; + import org.fedoraproject.maven.utils.ArtifactUtils; + import org.fedoraproject.maven.utils.LoggingUtils; ++import org.objectweb.asm.ClassReader; ++import org.objectweb.asm.MethodVisitor; ++import org.objectweb.asm.Opcodes; ++import org.objectweb.asm.commons.EmptyVisitor; + import org.sonatype.aether.artifact.Artifact; + import org.sonatype.aether.util.artifact.DefaultArtifact; + +@@ -517,7 +517,7 @@ public class DefaultInstaller + + final boolean[] usesNativeCode = new boolean[1]; + +- new ClassReader( jis ).accept( new ClassVisitor( Opcodes.ASM4 ) ++ new ClassReader( jis ).accept( new EmptyVisitor() + { + @Override + public MethodVisitor visitMethod( int flags, String name, String desc, String sig, String[] exc ) +diff --git a/xmvn-mojo/pom.xml b/xmvn-mojo/pom.xml +index 14505d2..9b9ae1f 100644 +--- a/xmvn-mojo/pom.xml ++++ b/xmvn-mojo/pom.xml +@@ -68,8 +68,8 @@ + plexus-component-annotations + + +- org.eclipse.sisu +- org.eclipse.sisu.plexus ++ org.sonatype.sisu ++ sisu-inject-plexus + + + org.sonatype.aether +diff --git a/xmvn-parent/pom.xml b/xmvn-parent/pom.xml +index bfa4da6..76894d2 100644 +--- a/xmvn-parent/pom.xml ++++ b/xmvn-parent/pom.xml +@@ -75,13 +75,14 @@ + US-ASCII + + 1.13.1 ++ 3.3.1 + 1.32 + 2.1.1 + 3.0.5 + 3.0.15 + 1.5.5 + 3.2 +- 0.0.0.M5 ++ 2.3.0 + + + 1.3.2.GA +@@ -155,8 +156,8 @@ + ${plexusVersion} + + +- org.eclipse.sisu +- org.eclipse.sisu.plexus ++ org.sonatype.sisu ++ sisu-inject-plexus + ${sisuVersion} + + +@@ -194,6 +195,16 @@ + maven-invoker + ${mavenInvokerVersion} + ++ ++ asm ++ asm ++ ${asmVersion} ++ ++ ++ asm ++ asm-commons ++ ${asmVersion} ++ + + + +diff --git a/xmvn-tools/pom.xml b/xmvn-tools/pom.xml +index e1b21a3..8f68dfe 100644 +--- a/xmvn-tools/pom.xml ++++ b/xmvn-tools/pom.xml +@@ -48,8 +48,8 @@ + xmvn-core + + +- org.eclipse.sisu +- org.eclipse.sisu.plexus ++ org.sonatype.sisu ++ sisu-inject-plexus + + + +-- +1.8.4.2 + diff --git a/SOURCES/0004-Add-support-for-absolute-artifact-symlinks.patch b/SOURCES/0004-Add-support-for-absolute-artifact-symlinks.patch new file mode 100644 index 0000000..721822e --- /dev/null +++ b/SOURCES/0004-Add-support-for-absolute-artifact-symlinks.patch @@ -0,0 +1,114 @@ +From 5ba0fab707d9a4bf7ba46d5bf17887f91ad16ca4 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Mon, 6 Jan 2014 14:45:06 +0100 +Subject: [PATCH 4/4] Add support for absolute artifact symlinks + +[backport-feature-absolute-symlinks] +--- + .../maven/installer/impl/DefaultInstaller.java | 51 +++++++++++++++++----- + .../maven/installer/impl/Package.java | 6 ++- + 2 files changed, 46 insertions(+), 11 deletions(-) + +diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java +index e22905f..efaeeaf 100644 +--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java ++++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java +@@ -255,8 +255,7 @@ public class DefaultInstaller + for ( Path basePath : basePaths ) + { + if ( basePath.isAbsolute() ) +- throw new RuntimeException( "Absolute JPP artifact paths are not supported: artifact: " + artifact +- + ", path: " + basePath ); ++ continue; + + Path jppName = basePath.getFileName(); + Path jppGroup = Paths.get( "JPP" ); +@@ -280,9 +279,35 @@ public class DefaultInstaller + } + } + ++ if ( jppArtifacts.isEmpty() ) ++ throw new RuntimeException( "At least one non-absolute file must be specified for artifact " + artifact ); ++ + return jppArtifacts; + } + ++ private void installAbsoluteSymlinks( Package pkg, Artifact artifact, PackagingRule rule, Path symlinkTarget ) ++ throws IOException ++ { ++ List versionSuffixes = new ArrayList<>(); ++ for ( String version : rule.getVersions() ) ++ versionSuffixes.add( "-" + version ); ++ if ( rule.getVersions().isEmpty() ) ++ versionSuffixes.add( "" ); ++ ++ for ( String filePath : rule.getFiles() ) ++ { ++ String classifierSuffix = artifact.getClassifier().isEmpty() ? "" : "-" + artifact.getClassifier(); ++ String extensionSuffix = artifact.getExtension().isEmpty() ? "" : "." + artifact.getExtension(); ++ ++ for ( String versionSuffix : versionSuffixes ) ++ { ++ Path symlink = Paths.get( filePath + versionSuffix + classifierSuffix + extensionSuffix ); ++ if ( symlink.isAbsolute() ) ++ pkg.addSymlink( Paths.get( "/" ).relativize( symlink ), symlinkTarget ); ++ } ++ } ++ } ++ + private void installArtifact( Package pkg, Artifact artifact, List aliases, List jppArtifacts ) + throws IOException + { +@@ -586,18 +611,24 @@ public class DefaultInstaller + + develArtifacts.add( artifact ); + } +- else if ( !isAttachedArtifact ) ++ else + { +- installPomFiles( pkg, artifact, jppArtifacts ); ++ Path primaryJppArtifactPath = jppArtifacts.iterator().next().getFile().toPath(); ++ installAbsoluteSymlinks( pkg, artifact, rule, primaryJppArtifactPath ); + +- Set userArtifacts = packageUserArtifacts.get( pkg ); +- if ( userArtifacts == null ) ++ if ( !isAttachedArtifact ) + { +- userArtifacts = new LinkedHashSet<>(); +- packageUserArtifacts.put( pkg, userArtifacts ); +- } ++ installPomFiles( pkg, artifact, jppArtifacts ); + +- userArtifacts.add( artifact ); ++ Set userArtifacts = packageUserArtifacts.get( pkg ); ++ if ( userArtifacts == null ) ++ { ++ userArtifacts = new LinkedHashSet<>(); ++ packageUserArtifacts.put( pkg, userArtifacts ); ++ } ++ ++ userArtifacts.add( artifact ); ++ } + } + } + +diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java +index 104c53d..79140a6 100644 +--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java ++++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java +@@ -83,7 +83,11 @@ class Package + + public void addFile( Path file, Path target, int mode ) + { +- addFile( file, target.getParent(), target.getFileName(), mode ); ++ Path parent = target.getParent(); ++ if ( parent == null ) ++ parent = Paths.get( "." ); ++ ++ addFile( file, parent, target.getFileName(), mode ); + } + + public void addSymlink( Path symlinkFile, Path symlinkTarget ) +-- +1.8.4.2 + diff --git a/SPECS/xmvn.spec b/SPECS/xmvn.spec index 1a7cc94..2f5514c 100644 --- a/SPECS/xmvn.spec +++ b/SPECS/xmvn.spec @@ -1,13 +1,16 @@ Name: xmvn Version: 1.3.0 -Release: 3%{?dist} +Release: 5%{?dist} Summary: Local Extensions for Apache Maven License: ASL 2.0 URL: http://mizdebsk.fedorapeople.org/xmvn BuildArch: noarch Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz -Patch1: 0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch +Patch0001: 0001-Port-to-Maven-3.0.5-and-Sonatype-Aether.patch +Patch0002: 0002-Remove-integration-with-for-Apache-Ivy.patch +Patch0003: 0003-Port-to-Sonatype-Sisu.patch +Patch0004: 0004-Add-support-for-absolute-artifact-symlinks.patch BuildRequires: maven >= 3.0.5-14 BuildRequires: maven-local @@ -36,7 +39,10 @@ This package provides %{summary}. %prep %setup -q -%patch1 -p1 +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 # remove dependency plugin maven-binaries execution # we provide apache-maven by symlink @@ -142,6 +148,13 @@ end %doc LICENSE NOTICE %changelog +* Fri Jan 10 2014 Mikolaj Izdebski - 1.3.0-5 +- Split 1 patch to 3 patches, one per feature +- Add support for absolute artifact symlinks + +* Fri Dec 27 2013 Daniel Mach - 1.3.0-4 +- Mass rebuild 2013-12-27 + * Thu Nov 7 2013 Mikolaj Izdebski - 1.3.0-3 - Fix guice symlinks