Skip to content

Commit

Permalink
[MRELEASE-1148] Release Manager pulls in transitive dependencies
Browse files Browse the repository at this point in the history
This closes #219
  • Loading branch information
michael-o committed Jun 13, 2024
1 parent 2142c9e commit 7249d1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private Scm createReleaseScm(Scm scm, ScmTranslator scmTranslator, ReleaseDescri

private List<Dependency> createReleaseDependencies(ReleaseDescriptor releaseDescriptor, MavenProject project)
throws ReleaseFailureException {
Set<Artifact> artifacts = project.getArtifacts();
Set<Artifact> artifacts = project.getDependencyArtifacts();

List<Dependency> releaseDependencies = null;

Expand All @@ -471,6 +471,12 @@ private List<Dependency> createReleaseDependencies(ReleaseDescriptor releaseDesc
releaseDependencies = new ArrayList<>();

for (Artifact artifact : orderedArtifacts) {
if (artifact.getVersion() == null) {
artifact.setVersion(project.getArtifactMap()
.get(ArtifactUtils.versionlessKey(artifact))
.getVersion());
}

Dependency releaseDependency = new Dependency();

releaseDependency.setGroupId(artifact.getGroupId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ under the License.
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>groupId</groupId>
<artifactId>subproject1</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>groupId</groupId>
<artifactId>subproject2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ under the License.
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>groupId</groupId>
<artifactId>subproject1</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>groupId</groupId>
<artifactId>subproject2</artifactId>
Expand Down

0 comments on commit 7249d1f

Please sign in to comment.