You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is even possible but I thought I would throw it out there. :) Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Currently it is possible to get the maven Model from the execution result.
result.getMavenProjectResult().getModel()
In a multi-module project, you can currently only get the path to a nested POM and use the MavenXpp3Reader to read it to get the nested Model.
assertThat(result)
.isSuccessful()
.satisfies(r -> {
assertThat(new File(r.getMavenProjectResult().getTargetProjectDirectory(), "test-jar1/pom.xml"))
.as("Jar1 POM file")
.exists()
.satisfies(f -> {
assertThat(readPomModelFromFile(f))
.as("Jar1 POM Model")
.isNotNull()
.extracting(Model::getGroupId, Model::getArtifactId, Model::getVersion, Model::getPackaging)
.as("GAVP")
.containsExactly("me.jwt007.maven.plugins.foobar.its", "foobar-jar1", "1.2.3", "jar");
});
});
private Model readPomModelFromFile(final File pomFile) {
Model model = null;
try (FileInputStream fis = new FileInputStream(pomFile)) {
model = (new MavenXpp3Reader()).read(fis);
} catch (Exception ex) {
fail("Unable to parse flattened POM model from: " + pomFile, ex);
}
assertNotNull(model);
return model;
}
Describe the solution you'd like
A clear and concise description of what you want to happen.
If possible it would be great if there was a convenience function to get the Model of a sub-module in a multi-module project.
Maybe this request makes no sense... sorry I am no assertj expert and am sort of learning by doing now.
I guess to get the Model you need to do the satisfies/assertThat to get at the "actual" where the Model lives. Since I am assuming you don't want to write AssertJ extensions for the whole Maven model. :)
But if I am not totally off :) (not the subject of this issue)...
It should be relatively easy to add the following to MavenProjectResultAssert since you are saving the Optional<MavenProjectResultAssert> parent.
I don't know if this is even possible but I thought I would throw it out there. :)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Currently it is possible to get the maven
Model
from the execution result.result.getMavenProjectResult().getModel()
In a multi-module project, you can currently only get the path to a nested POM and use the MavenXpp3Reader to read it to get the nested Model.
Describe the solution you'd like
A clear and concise description of what you want to happen.
If possible it would be great if there was a convenience function to get the Model of a sub-module in a multi-module project.
result.getMavenProjectResult().getModule("myjars").getModule("jar1").getModel()
.. or something along those lines. :).
It would reduce the test size by a few lines and eliminate the need for a helper function (at least in my code :P)
The text was updated successfully, but these errors were encountered: