Class MvnPublisher
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
org.jdrupes.builder.mvnrepo.MvnPublisher
- All Implemented Interfaces:
Generator, ResourceProvider
A Generator for maven deployments in response to requests for
MvnPublication It supports publishing releases using the
Publish Portal API
and publishing snapshots using the "traditional" maven approach
(uploading the files, including the appropriate maven-metadata.xml
files).
The publisher requests the PomFile from the project and uses
the groupId, artfactId and version as specified in this file.
It also requests the LibraryJarFile, the SourcesJarFile and
the JavadocJarFile. The latter two are optional for snapshot
releases.
-
Field Summary
Fields inherited from class AbstractProvider
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the directory where additional artifacts are created.artifactDirectory(Path directory) Sets the directory where additional artifacts are created.artifactDirectory(Supplier<Path> directory) Sets the directory where additional artifacts are created.credentials(String user, String pass) Sets the Maven repository credentials.doProvide(ResourceRequest<T> requested) Invoked byAbstractProvider.provide(ResourceRequest)after checking if the invocation is allowed.Keep generated sub artifacts (checksums, signatures)Publish the release automatically.Returns the snapshot repository.snapshotRepository(URI uri) Sets the Maven snapshot repository URI.Returns the upload URI.Sets the upload URI.Methods inherited from class AbstractProvider
provideMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
provide
-
Constructor Details
-
MvnPublisher
Creates a new Maven publication generator.- Parameters:
project- the project
-
-
Method Details
-
uploadUri
Sets the upload URI.- Parameters:
uri- the repository URI- Returns:
- the maven publication generator
-
uploadUri
-
snapshotRepository
Sets the Maven snapshot repository URI.- Parameters:
uri- the snapshot repository URI- Returns:
- the maven publication generator
-
snapshotRepository
Returns the snapshot repository. Defaults tohttps://central.sonatype.com/repository/maven-snapshots/.- Returns:
- the uri
-
credentials
Sets the Maven repository credentials.- Parameters:
user- the usernamepass- the password- Returns:
- the maven publication generator
-
keepSubArtifacts
Keep generated sub artifacts (checksums, signatures)- Returns:
- the mvn publication generator
-
publishAutomatically
Publish the release automatically.- Returns:
- the mvn publisher
-
artifactDirectory
Returns the directory where additional artifacts are created. Defaults to sub directorypublications/mavenin the project's build directory (seeProject.buildDirectory()).- Returns:
- the directory
-
artifactDirectory
Sets the directory where additional artifacts are created. ThePathis resolved against the project's build directory (seeProject.buildDirectory()). Ifdestinationisnull, the additional artifacts are created in the directory where the base artifact is found.- Parameters:
directory- the new directory- Returns:
- the maven publication generator
-
artifactDirectory
Sets the directory where additional artifacts are created. If theSupplierreturnsnull, the additional artifacts are created in the directory where the base artifact is found.- Parameters:
directory- the new directory- Returns:
- the maven publication generator
-
doProvide
Description copied from class:AbstractProviderInvoked byAbstractProvider.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
requested- the requested- Returns:
- the stream
-