plugin-health-scoring
plugin-health-scoring copied to clipboard
Finding plugin module in multi-module repository
Description
In the case of repository using a multi-module configuration, we need to know in which module the plugin source code is located.
Browsing the pom.xml files within the repository, filtering those with a <packaging/> value of hpi and then looking at the artifactId we can find the module which hold the plugin source code.
We should store that value in the ProbeContext, it has uses for probe currently using the folder of the SCMLinkValidationProbe.
Is this issue still open?
MavenXpp3Reader mavenReader = new MavenXpp3Reader();
try (Reader reader = new InputStreamReader(new FileInputStream(pomFilePath.toFile()), StandardCharsets.UTF_8)) {
Model model = mavenReader.read(reader);
if ("hpi".equals(model.getPackaging()) && pluginName.equals(model.getArtifactId())) {
return true;
}
} catch (IOException e) {
LOGGER.error("Pom file not found for {}.", pluginName, e);
} catch (XmlPullParserException e) {
LOGGER.error("Could not parse pom file for {}.", pluginName, e);
}
return false;
cause seem to be implemented already
@alecharp Please add GSOC label