plugin-health-scoring icon indicating copy to clipboard operation
plugin-health-scoring copied to clipboard

Finding plugin module in multi-module repository

Open alecharp opened this issue 2 years ago • 2 comments

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.

alecharp avatar Jun 16 '23 10:06 alecharp

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

sridamul avatar Feb 14 '24 15:02 sridamul

@alecharp Please add GSOC label

AayushSaini101 avatar Mar 04 '24 11:03 AayushSaini101