[JBoss JIRA] (SHRINKRES-190) implements equals and hashCode methods in MavenResolvedArtifactImpl / MavenArtifactInfoImpl
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-190?page=com.atlassian.jira.plu... ]
Karel Piwko closed SHRINKRES-190.
---------------------------------
> implements equals and hashCode methods in MavenResolvedArtifactImpl / MavenArtifactInfoImpl
> -------------------------------------------------------------------------------------------
>
> Key: SHRINKRES-190
> URL: https://issues.jboss.org/browse/SHRINKRES-190
> Project: ShrinkWrap Resolvers
> Issue Type: Feature Request
> Components: maven
> Affects Versions: 2.1.1
> Reporter: Mathieu Lachance
> Assignee: Karel Piwko
> Fix For: 2.2.0-beta-1
>
>
> I'm currently to find an effective way to filter out many dependencies at once that I could provide within a "dummy" pom.xml.
> I'd like to do the following:
> {code:java}
> public static List<MavenResolvedArtifact> resolveAllTestNonTransitiveDependencies() {
> return Arrays.asList(
> Maven.resolver()
> .loadPomFromFile("pom.xml")
> .importTestDependencies().resolve()
> .withoutTransitivity()
> .asResolvedArtifact());
> }
>
> public static List<MavenResolvedArtifact> resolveAllArquillianDependencies() {
> return Arrays.asList(
> Maven.resolver()
> .loadPomFromFile("src/test/resources/arquillian.pom.xml")
> .importTestDependencies().resolve()
> .withoutTransitivity()
> .asResolvedArtifact());
> }
>
> public static List<MavenResolvedArtifact> resolveAllTestNonTransitiveNonArquillianDependencies() {
> List<MavenResolvedArtifact> testDependencies = resolveAllTestNonTransitiveDependencies();
>
> List<MavenResolvedArtifact> arquillianDependencies = resolveAllArquillianDependencies();
>
> List<MavenResolvedArtifact> filteredTestDependencies = new ArrayList<MavenResolvedArtifact>();
> for (MavenResolvedArtifact testDependency : testDependencies) {
> if (!arquillianDependencies.contains(testDependency)) {
> filteredTestDependencies.add(testDependency);
> }
> }
> return filteredTestDependencies;
> }
> {code}
> The problem is that MavenResolvedArtifactImpl does not implements equals and hashCode needed for using Collection::contains method.
> I think it would be safe to delegate MavenResolvedArtifactImpl / MavenArtifactInfoImpl equals and hashCode methods to the one defined in MavenCoordinateImpl
> Thanks,
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 7 months
[JBoss JIRA] (SHRINKRES-183) Resolvers.configure(Class, ClassLoader) ignores ClassLoader?
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-183?page=com.atlassian.jira.plu... ]
Karel Piwko closed SHRINKRES-183.
---------------------------------
> Resolvers.configure(Class,ClassLoader) ignores ClassLoader?
> -----------------------------------------------------------
>
> Key: SHRINKRES-183
> URL: https://issues.jboss.org/browse/SHRINKRES-183
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: api
> Affects Versions: 2.1.0, 2.2.0-alpha-2, 2.1.1
> Reporter: Thomas Maslen
> Assignee: Karel Piwko
> Fix For: 2.2.0-beta-1
>
>
> [No, I wasn't trying to use this, I just noticed it while looking at the source. It looks to me like a regression, but you gents would be better judges of that than I am]
> The Resolvers.configure(Class,ClassLoader) method ignores its ClassLoader argument; the only argument that it passes to ResolverSystemFactory.createFromUserView() is the Class.
> Offhand it looks like a cut-and-paste from the method above?
> If I'm reading Git right this was introduced in the fix for SHRINKRES-173 that went into 2.1.0, and it's present in 2.1.0 and above, including the current master.
> Happily, Resolvers.use(Class,ClassLoader) passes both arguments to ResolverSystemFactory as expected.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 7 months
[JBoss JIRA] (SHRINKRES-176) MavenImporter archive name
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKRES-176?page=com.atlassian.jira.plu... ]
Karel Piwko closed SHRINKRES-176.
---------------------------------
> MavenImporter archive name
> --------------------------
>
> Key: SHRINKRES-176
> URL: https://issues.jboss.org/browse/SHRINKRES-176
> Project: ShrinkWrap Resolvers
> Issue Type: Bug
> Components: maven
> Reporter: Michael Irwin
> Assignee: Karel Piwko
> Fix For: 2.2.0-beta-1
>
>
> When using the MavenImporter, the archiveName property is ignored.
> {code}
> WebArchive archive = ShrinkWrap.create(MavenImporter.class, "test.war")
> .loadPomFromFile("pom.xml")
> .importBuildOutput()
> .as(WebArchive.class);
> System.out.println(archive.getName());
> {code}
> The archive name will be whatever the name of the Maven artifact is, which is usually [artifactId]-[version].
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 7 months