Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #10: Running version against Maven 3.1.1+ #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import org.apache.maven.shared.filtering.MavenResourcesExecution
import org.codehaus.plexus.util.FileUtils
import org.gcontracts.annotations.Ensures
import org.gcontracts.annotations.Requires
import org.sonatype.aether.deployment.DeployRequest
import org.sonatype.aether.repository.RemoteRepository
import org.sonatype.aether.resolution.ArtifactDescriptorRequest
import org.eclipse.aether.deployment.DeployRequest
import org.eclipse.aether.repository.RemoteRepository
import org.eclipse.aether.resolution.ArtifactDescriptorRequest
import org.apache.maven.shared.filtering.DefaultMavenFileFilter.Wrapper
import java.util.jar.Attributes
import java.util.jar.Manifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.gcontracts.annotations.Requires
/**
* {@link ArtifactsFilter} implementation filtering artifacts according to their scope,
* similarly to
* {@link org.sonatype.aether.util.graph.selector.ScopeDependencySelector#selectDependency(org.sonatype.aether.graph.Dependency)}
* {@link org.eclipse.aether.util.graph.selector.ScopeDependencySelector#selectDependency(org.eclipse.aether.graph.Dependency)}
* and not
* {@link org.apache.maven.shared.artifact.filter.collection.ScopeFilter#filter(java.util.Set)}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package com.github.goldin.plugins.ivy
import static com.github.goldin.plugins.common.GMojoUtils.*
import org.gcontracts.annotations.Ensures
import org.gcontracts.annotations.Requires
import org.sonatype.aether.RepositorySystemSession
import org.sonatype.aether.impl.ArtifactResolver
import org.sonatype.aether.resolution.ArtifactRequest
import org.sonatype.aether.resolution.ArtifactResult
import org.sonatype.aether.util.artifact.DefaultArtifact
import org.eclipse.aether.RepositorySystemSession
import org.eclipse.aether.impl.ArtifactResolver
import org.eclipse.aether.resolution.ArtifactRequest
import org.eclipse.aether.resolution.ArtifactResult
import org.eclipse.aether.artifact.DefaultArtifact


/**
Expand Down Expand Up @@ -46,8 +46,8 @@ class IvyArtifactResolver implements ArtifactResolver {
final extension = a.extension
// Artifact may have no "file" set if resolution fails and helper's "failOnError" is "false"
final artifact = ivyHelper.resolve( organisation, name, revision, extension, pattern )
final result = new ArtifactResult( request ) // org.sonatype.aether.resolution.ArtifactResult
result.artifact = new DefaultArtifact( organisation, name, extension, revision ) // org.sonatype.aether.util.artifact.DefaultArtifact
final result = new ArtifactResult( request ) // org.eclipse.aether.resolution.ArtifactResult
result.artifact = new DefaultArtifact( organisation, name, extension, revision ) // org.eclipse.aether.artifact.DefaultArtifact
if ( artifact.file )
{
result.artifact = result.artifact.setFile( artifact.file )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.apache.maven.plugins.annotations.Parameter
import org.apache.maven.plugins.annotations.ResolutionScope
import org.gcontracts.annotations.Ensures
import org.gcontracts.annotations.Requires
import org.sonatype.aether.impl.internal.DefaultRepositorySystem
import org.eclipse.aether.internal.impl.DefaultRepositorySystem


/**
Expand Down
12 changes: 3 additions & 9 deletions maven-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,23 @@
</dependency>

<dependency>
<groupId>org.sonatype.aether</groupId>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${aether-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>${aether-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>${aether-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<version>${aether-version}</version>
<scope>provided</scope>
</dependency>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- org.apache.maven.shared -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import org.codehaus.plexus.DefaultPlexusContainer
import org.gcontracts.annotations.Ensures
import org.gcontracts.annotations.Requires
import org.slf4j.LoggerFactory
import org.sonatype.aether.RepositorySystem
import org.sonatype.aether.RepositorySystemSession
import org.sonatype.aether.repository.RemoteRepository
import org.sonatype.aether.resolution.ArtifactRequest
import org.eclipse.aether.RepositorySystem
import org.eclipse.aether.RepositorySystemSession
import org.eclipse.aether.repository.RemoteRepository
import org.eclipse.aether.resolution.ArtifactRequest
import org.springframework.util.ReflectionUtils
import java.lang.reflect.Field
import java.lang.reflect.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class ConversionUtils

@Requires({ aetherDependency })
@Ensures ({ result })
static org.apache.maven.artifact.Artifact toMavenArtifact ( org.sonatype.aether.graph.Dependency aetherDependency )
static org.apache.maven.artifact.Artifact toMavenArtifact ( org.eclipse.aether.graph.Dependency aetherDependency )
{
aetherDependency.artifact.with {
toMavenArtifact( groupId, artifactId, version, aetherDependency.scope, extension, classifier, aetherDependency.optional, file )
Expand All @@ -65,10 +65,10 @@ final class ConversionUtils

@Requires({ mavenArtifact })
@Ensures ({ result })
static org.sonatype.aether.artifact.Artifact toAetherArtifact ( org.apache.maven.artifact.Artifact mavenArtifact )
static org.eclipse.aether.artifact.Artifact toAetherArtifact ( org.apache.maven.artifact.Artifact mavenArtifact )
{
mavenArtifact.with {
new org.sonatype.aether.util.artifact.DefaultArtifact(
new org.eclipse.aether.artifact.DefaultArtifact(
groupId, artifactId, classifier, type, version, null, file )
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SilentLogger extends org.apache.log4j.Logger
implements org.apache.maven.plugin.logging.Log,
org.codehaus.plexus.logging.Logger,
org.apache.commons.logging.Log,
org.sonatype.aether.spi.log.Logger,
org.eclipse.aether.spi.log.Logger,
org.slf4j.Logger,
org.apache.ivy.util.MessageLogger
{
Expand Down
46 changes: 23 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
<java-version>1.6</java-version>

<!-- http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.maven%22%20AND%20a%3A%22maven-core%22 -->
<maven-version>3.0.5</maven-version>
<maven-version>3.1.1</maven-version>

<!-- http://evgenyg.artifactoryonline.com/evgenyg/plugins-releases/com/github/goldin/about-maven-plugin/ -->
<previous-plugins-version>0.3-beta-1</previous-plugins-version>
<!-- <previous-plugins-version>0.3-beta-1</previous-plugins-version> -->

<!-- http://evgenyg.artifactoryonline.com/evgenyg/repo/com/github/goldin/gcommons/ -->
<gcommons-version>0.6.3-SNAPSHOT</gcommons-version>
Expand All @@ -79,7 +79,7 @@
<ant-version>1.9.1</ant-version>

<!-- http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.sonatype.aether%22%20AND%20a%3A%22aether-api%22 -->
<aether-version>1.13.1</aether-version>
<aether-version>0.9.0.M2</aether-version>

<!-- http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.gcontracts%22%20AND%20a%3A%22gcontracts-core%22 -->
<gcontracts-version>1.2.12</gcontracts-version>
Expand Down Expand Up @@ -113,7 +113,7 @@
<module>find-maven-plugin</module>
<module>timestamp-maven-plugin</module>
<module>properties-maven-plugin</module>
<module>silencer-maven-plugin</module>
<!-- <module>silencer-maven-plugin</module> -->
<module>sshexec-maven-plugin</module>
<module>spring-batch-maven-plugin</module>
</modules>
Expand Down Expand Up @@ -260,25 +260,25 @@

<plugins>

<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>silencer-maven-plugin</artifactId>
<version>${previous-plugins-version}</version>
<executions>
<execution>
<id>enable-silencer</id>
<phase>validate</phase>
<goals>
<goal>silence</goal>
</goals>
<configuration>
<runIf>{{ System.getProperty( 'silence' ) != null }}</runIf>
<logSummary>true</logSummary>
<topN>5</topN>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin> -->
<!-- <groupId>com.github.goldin</groupId> -->
<!-- <artifactId>silencer-maven-plugin</artifactId> -->
<!-- <version>${previous-plugins-version}</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <id>enable-silencer</id> -->
<!-- <phase>validate</phase> -->
<!-- <goals> -->
<!-- <goal>silence</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <runIf>{{ System.getProperty( 'silence' ) != null }}</runIf> -->
<!-- <logSummary>true</logSummary> -->
<!-- <topN>5</topN> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Enforcing Maven/Java versions -->
Expand Down