Search in sources :

Example 6 with MavenArtifact

use of org.gradle.api.publish.maven.MavenArtifact in project gradle by gradle.

the class DefaultMavenArtifactSet method artifact.

@Override
public MavenArtifact artifact(Object source) {
    MavenArtifact artifact = mavenArtifactParser.parseNotation(source);
    add(artifact);
    return artifact;
}
Also used : MavenArtifact(org.gradle.api.publish.maven.MavenArtifact)

Example 7 with MavenArtifact

use of org.gradle.api.publish.maven.MavenArtifact in project gradle by gradle.

the class DefaultMavenArtifactSet method artifact.

@Override
public MavenArtifact artifact(Object source, Action<? super MavenArtifact> config) {
    MavenArtifact artifact = artifact(source);
    config.execute(artifact);
    return artifact;
}
Also used : MavenArtifact(org.gradle.api.publish.maven.MavenArtifact)

Example 8 with MavenArtifact

use of org.gradle.api.publish.maven.MavenArtifact in project gradle by gradle.

the class ValidatingMavenPublisher method validateArtifacts.

private void validateArtifacts(MavenNormalizedPublication publication) {
    for (MavenArtifact artifact : publication.getAllArtifacts()) {
        field(publication, "artifact extension", artifact.getExtension()).notNull().validInFileName();
        field(publication, "artifact classifier", artifact.getClassifier()).optionalNotEmpty().validInFileName();
        checkCanPublish(publication.getName(), artifact);
    }
}
Also used : MavenArtifact(org.gradle.api.publish.maven.MavenArtifact)

Example 9 with MavenArtifact

use of org.gradle.api.publish.maven.MavenArtifact in project gradle by gradle.

the class ValidatingMavenPublisher method checkNoDuplicateArtifacts.

private void checkNoDuplicateArtifacts(MavenNormalizedPublication publication) {
    Set<MavenArtifact> verified = new HashSet<>();
    for (MavenArtifact artifact : publication.getAllArtifacts()) {
        checkNotDuplicate(publication, verified, artifact.getExtension(), artifact.getClassifier());
        verified.add(artifact);
    }
}
Also used : MavenArtifact(org.gradle.api.publish.maven.MavenArtifact) HashSet(java.util.HashSet)

Aggregations

MavenArtifact (org.gradle.api.publish.maven.MavenArtifact)9 Metadata (org.apache.maven.artifact.repository.metadata.Metadata)3 Snapshot (org.apache.maven.artifact.repository.metadata.Snapshot)2 SnapshotVersion (org.apache.maven.artifact.repository.metadata.SnapshotVersion)2 Versioning (org.apache.maven.artifact.repository.metadata.Versioning)2 File (java.io.File)1 HashSet (java.util.HashSet)1 QName (javax.xml.namespace.QName)1 IvyArtifact (org.gradle.api.publish.ivy.IvyArtifact)1 IvyArtifactSet (org.gradle.api.publish.ivy.IvyArtifactSet)1 IvyPublication (org.gradle.api.publish.ivy.IvyPublication)1 IvyPublicationInternal (org.gradle.api.publish.ivy.internal.publication.IvyPublicationInternal)1 IvyNormalizedPublication (org.gradle.api.publish.ivy.internal.publisher.IvyNormalizedPublication)1 IvyPublicationIdentity (org.gradle.api.publish.ivy.internal.publisher.IvyPublicationIdentity)1 MavenArtifactSet (org.gradle.api.publish.maven.MavenArtifactSet)1 MavenPublication (org.gradle.api.publish.maven.MavenPublication)1 AbstractMavenArtifact (org.gradle.api.publish.maven.internal.artifact.AbstractMavenArtifact)1 DerivedMavenArtifact (org.gradle.api.publish.maven.internal.artifact.DerivedMavenArtifact)1 SingleOutputTaskMavenArtifact (org.gradle.api.publish.maven.internal.artifact.SingleOutputTaskMavenArtifact)1 MavenPublicationInternal (org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal)1