Skip to content

Commit

Permalink
[MNG-8327] Failure when building the consumer POM
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet authored and cstamas committed Oct 18, 2024
1 parent 2f7b962 commit 9b407d5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ class BuildSession implements AutoCloseable {
RepositoryUtils.overlay(request.getLocalRepository(), request.getRepositorySession(), repoSystem);
InternalSession iSession = InternalSession.from(session);
this.modelBuilderSession = modelBuilder.newSession();
iSession.getData().set(SessionData.key(ModelBuilder.ModelBuilderSession.class), modelBuilderSession);
// Save the ModelBuilderSession for later retrieval by the DefaultConsumerPomBuilder.
// Use replace(key, null, value) to make sure the *main* session, i.e. the one used
// to load the projects, is stored. This is to avoid the session being overwritten
// if a plugin uses the ProjectBuilder.
iSession.getData()
.replace(SessionData.key(ModelBuilder.ModelBuilderSession.class), null, modelBuilderSession);
}

@Override
Expand Down

0 comments on commit 9b407d5

Please sign in to comment.