[
https://issues.apache.org/jira/browse/MNG-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17789757#comment-17789757
]
ASF GitHub Bot commented on MNG-7945:
-------------------------------------
gnodet commented on code in PR #1323:
URL: https://github.com/apache/maven/pull/1323#discussion_r1405327196
##########
maven-core/src/test/java/org/apache/maven/internal/transformation/ConsumerPomArtifactTransformerTest.java:
##########
@@ -60,9 +56,15 @@ void transform() throws Exception {
try (InputStream expected = Files.newInputStream(beforePomFile)) {
Model model = new Model(new MavenStaxReader().read(expected));
MavenProject project = new MavenProject(model);
- ConsumerPomArtifactTransformer t = new
ConsumerPomArtifactTransformer(modelBuilder);
- t.createConsumerPomArtifact(project, tempFile, systemSessionMock)
- .transform(beforePomFile, tempFile, model.getDelegate());
+ ConsumerPomArtifactTransformer t = new
ConsumerPomArtifactTransformer((s, p, f) -> {
+ try (InputStream is = Files.newInputStream(f)) {
+ return DefaultConsumerPomBuilder.transform(new
MavenStaxReader().read(is));
+ } catch (Exception e) {
Review Comment:
If you mean "you should not catch the exception and let it bubble through
and let the exception make the test fail", it unfortunately is not doable
because of the usage of checked exceptions. Adding an exception to the
interface would go up the chain to
https://github.com/apache/maven/blob/7b38457506544854cdd26aa1d49608050217b923/maven-artifact/src/main/java/org/apache/maven/artifact/Artifact.java#L82
which is part of the API and should not be changed. So while I would happily
remove it if possible, I don't see any good solution.
> Fix profile settings being injected into consumer POMs
> ------------------------------------------------------
>
> Key: MNG-7945
> URL: https://issues.apache.org/jira/browse/MNG-7945
> Project: Maven
> Issue Type: Bug
> Affects Versions: 4.0.0-alpha-8
> Reporter: Tamas Cservenak
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.0.0-alpha-9
>
>
> The consumer POMs may end up containing information from user settings.
> The reason is that they are currently built from the effective POMs. They
> need to be rebuilt based on raw models.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)