Interface PipelineMavenPluginDao
- All Superinterfaces:
AutoCloseable, Closeable
- All Known Implementing Classes:
AbstractPipelineMavenPluginDaoDecorator, CustomTypePipelineMavenPluginDaoDecorator, MonitoringPipelineMavenPluginDaoDecorator, PipelineMavenPluginNullDao
- Author:
- Cyrille Le Clerc
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Routine task to cleanup the database and reclaim disk space (if possible in the underlying database).voiddeleteBuild(String jobFullName, int buildNumber) Sync database when a build is deleted (seeRunListener.onDeleted(Run))voidSync database when a job is deleted (seeItemListener.onDeleted(Item))default StringgetGeneratedArtifacts(String jobFullName, int buildNumber) Return the artifacts generated by the given build.booleanIndicates if the underlying database is production grade enough for the workload.listDependencies(String jobFullName, int buildNumber) Return the dependencies registered by the given build.listDownstreamJobs(String jobFullName, int buildNumber) Deprecated.listDownstreamJobs(String groupId, String artifactId, String version, String baseVersion, String type) List the downstream jobs who have a dependency on the given artifact.listDownstreamJobs(String groupId, String artifactId, String version, String baseVersion, String type, String classifier) List the downstream jobs who have a dependency on the given artifact.listDownstreamJobsByArtifact(String jobFullName, int buildNumber) List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName,buildNumber).listTransitiveUpstreamJobs(String jobFullName, int buildNumber) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber)listTransitiveUpstreamJobs(String jobFullName, int buildNumber, UpstreamMemory upstreamMemory) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber) Use a memory for already known upstreams to boost performancelistUpstreamJobs(String jobFullName, int buildNumber) List the upstream jobs who generate an artifact that the given build depends on (build identified by the givenjobFullName,buildNumber) Doesn't return the passed job in case where a pipeline consumes an artifact it also producesvoidrecordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) TODO addMavenArtifactas org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these detailsvoidrecordDependency(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String scope, boolean ignoreUpstreamTriggers, String classifier) Record a Maven dependency of a build.voidrecordGeneratedArtifact(String jobFullName, int buildNumber, String groupId, String artifactId, String version, String type, String baseVersion, String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) Record a Maven artifact generated in a build.voidrecordParentProject(String jobFullName, int buildNumber, String parentGroupId, String parentArtifactId, String parentVersion, boolean ignoreUpstreamTriggers) Record a Maven parent project of a pom processed by this build of a build.voidSync database when a job is renamed (seeItemListener.onRenamed(Item, String, String))Human readable toStringvoidupdateBuildOnCompletion(String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Update the database with build result details.
-
Method Details
-
recordDependency
void recordDependency(@NonNull String jobFullName, int buildNumber, @NonNull String groupId, @NonNull String artifactId, @NonNull String version, @NonNull String type, @NonNull String scope, boolean ignoreUpstreamTriggers, String classifier) Record a Maven dependency of a build.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()groupId- Maven dependency groupIdartifactId- Maven dependency artifactIdversion- Maven dependency versiontype- Maven dependency type (e.g. "jar", "war", "pom", hpi"...)scope- Maven dependency scope ("compile", "test", "provided"...)ignoreUpstreamTriggers- see PipelineGraphPublisher#isIgnoreUpstreamTriggers()classifier- Maven dependency classifier
-
recordParentProject
void recordParentProject(@NonNull String jobFullName, int buildNumber, @NonNull String parentGroupId, @NonNull String parentArtifactId, @NonNull String parentVersion, boolean ignoreUpstreamTriggers) Record a Maven parent project of a pom processed by this build of a build.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()parentGroupId- Maven dependency groupIdparentArtifactId- Maven dependency artifactIdparentVersion- Maven dependency versionignoreUpstreamTriggers- see PipelineGraphPublisher#isIgnoreUpstreamTriggers()
-
recordGeneratedArtifact
void recordGeneratedArtifact(@NonNull String jobFullName, int buildNumber, @NonNull String groupId, @NonNull String artifactId, @NonNull String version, @NonNull String type, @NonNull String baseVersion, @Nullable String repositoryUrl, boolean skipDownstreamTriggers, String extension, String classifier) Record a Maven artifact generated in a build.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()groupId- Maven artifact groupIdartifactId- Maven artifact artifactIdversion- Maven artifact version, the "expanded version" for snapshots who have been "mvn deploy" or equivalent (e.g. "1.1-20170808.155524-66" for "1.1-SNAPSHOT" deployed to a repo)type- Maven artifact type (e.g. "jar", "war", "pom", hpi"...)baseVersion- Maven artifact version, the NOT "expanded version" for snapshots who have been "mvn deploy" or equivalent (e.g. baseVersion is "1.1-SNAPSHOT" for a "1.1-SNAPSHOT" artifact that has been deployed to a repo and expanded to "1.1-20170808.155524-66")repositoryUrl- URL of the Maven repository on which the artifact is deployed ("mvn deploy").nullif the artifact was not deployedskipDownstreamTriggers- see PipelineGraphPublisher#isSkipDownstreamTriggers()extension-classifier-
-
recordBuildUpstreamCause
void recordBuildUpstreamCause(String upstreamJobName, int upstreamBuildNumber, String downstreamJobName, int downstreamBuildNumber) TODO addMavenArtifactas org.jenkinsci.plugins.pipeline.maven.cause.MavenDependencyUpstreamCause gives these details- Parameters:
upstreamJobName- Job that triggered the build. SeeItem.getFullName().upstreamBuildNumber- Job that triggered the build. SeeRun.getNumber().downstreamJobName- Job that is triggered. SeeItem.getFullName().downstreamBuildNumber- Job that is triggered. SeeRun.getNumber().
-
listDependencies
Return the dependencies registered by the given build.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- sorted list of maven artifacts.
- See Also:
-
getGeneratedArtifacts
Return the artifacts generated by the given build.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- sorted list of generated maven artifacts.
-
renameJob
Sync database when a job is renamed (seeItemListener.onRenamed(Item, String, String))- Parameters:
oldFullName- seeItem.getFullName()newFullName- seeItem.getFullName()- See Also:
-
deleteJob
Sync database when a job is deleted (seeItemListener.onDeleted(Item))- Parameters:
jobFullName- seeItem.getFullName()- See Also:
-
deleteBuild
Sync database when a build is deleted (seeRunListener.onDeleted(Run))- Parameters:
jobFullName- seeItem.getFullName()- See Also:
-
listDownstreamJobs
Deprecated.List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName,buildNumber). Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of job full names (see
Item.getFullName()) - See Also:
-
listDownstreamJobsByArtifact
@NonNull Map<MavenArtifact, SortedSet<String>> listDownstreamJobsByArtifact(@NonNull String jobFullName, int buildNumber) List the downstream jobs who have a dependency on an artifact that has been generated by the given build (build identified by the givenjobFullName,buildNumber). Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of job full names (see
Item.getFullName()) byMavenArtifact - See Also:
-
listDownstreamJobs
@NonNull default SortedSet<String> listDownstreamJobs(@NonNull String groupId, @NonNull String artifactId, @NonNull String version, @Nullable String baseVersion, @NonNull String type) List the downstream jobs who have a dependency on the given artifact.- Parameters:
groupId- Maven artifact group ID (see Artifact#getArtifactId())artifactId- Maven artifact id (see Artifact#getArtifactId())version- Maven artifact version (see Artifact#getVersion())baseVersion- Maven artifact (see Artifact#getBaseVersion())type- Maven artifact type (see Artifact#getType())- Returns:
- list of job full names (see
Item.getFullName()) by {MavenArtifact} - See Also:
-
listDownstreamJobs
@NonNull SortedSet<String> listDownstreamJobs(@NonNull String groupId, @NonNull String artifactId, @NonNull String version, @Nullable String baseVersion, @NonNull String type, @Nullable String classifier) List the downstream jobs who have a dependency on the given artifact.- Parameters:
groupId- Maven artifact group ID (see Artifact#getArtifactId())artifactId- Maven artifact id (see Artifact#getArtifactId())version- Maven artifact version (see Artifact#getVersion())baseVersion- Maven artifact (see Artifact#getBaseVersion())type- Maven artifact type (see Artifact#getType())classifier- Maven artifact classifier (see Artifact#getClassifier())- Returns:
- list of job full names (see
Item.getFullName()) byMavenArtifact - See Also:
-
listUpstreamJobs
List the upstream jobs who generate an artifact that the given build depends on (build identified by the givenjobFullName,buildNumber) Doesn't return the passed job in case where a pipeline consumes an artifact it also produces- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of builds : key
Item.getFullName(), value:Run.getNumber() - See Also:
-
listTransitiveUpstreamJobs
@NonNull Map<String,Integer> listTransitiveUpstreamJobs(@NonNull String jobFullName, int buildNumber) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber)- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()- Returns:
- list of job full names (see
Item.getFullName()) - See Also:
-
listTransitiveUpstreamJobs
@NonNull Map<String,Integer> listTransitiveUpstreamJobs(@NonNull String jobFullName, int buildNumber, UpstreamMemory upstreamMemory) List the upstream jobs who generate an artifact that the given build depends on, including transitive dependencies (build identified by the givenjobFullName,buildNumber) Use a memory for already known upstreams to boost performance- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()upstreamMemory- seeUpstreamMemory- if called for several jobs in a loop we save the already known upstreams- Returns:
- list of job full names (see
Item.getFullName()) - See Also:
-
cleanup
void cleanup()Routine task to cleanup the database and reclaim disk space (if possible in the underlying database). -
toPrettyString
String toPrettyString()Human readable toString -
getDescription
String getDescription() -
updateBuildOnCompletion
void updateBuildOnCompletion(@NonNull String jobFullName, int buildNumber, int buildResultOrdinal, long startTimeInMillis, long durationInMillis) Update the database with build result details.- Parameters:
jobFullName- seeItem.getFullName()buildNumber- seeRun.getNumber()buildResultOrdinal- seeResult.ordinalstartTimeInMillis- seeRun.getStartTimeInMillis()durationInMillis- seeRun.getDuration()
-
isEnoughProductionGradeForTheWorkload
boolean isEnoughProductionGradeForTheWorkload()Indicates if the underlying database is production grade enough for the workload. H2 database is not enough for production grade workloads of the pipeline-maven-plugin.- Returns:
falseif the underlying database is not production grade enough for the workload
-
getBuilder
PipelineMavenPluginDao.Builder getBuilder() -
getDefaultJdbcUrl
-
listDownstreamJobsByArtifact(String, int)