Skip to content

Added support for plugin with dependency from related project #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jiri-meluzin
Copy link

Currently I have a multi-module project where I use jsonschema2pojo-maven-plugin to generate pojo classes from JSON schemas and I needed to add there a customAnotator from my another module.

Here is a part of the build plugin configuration:

   <plugin>
    <groupId>io.github.jiri-meluzin</groupId>
    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
    <version>1.2.2-VFGenericsFix</version>
    <dependencies>
      <dependency>
        <groupId>xxxx.yaml</groupId>
        <artifactId>annotator</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
    <configuration>
      <customAnnotator>xxxx.yaml.annotator.HideObjectsWithDefaultValue</customAnnotator>
      ....
      <targetPackage>xxxx.config.globalconfig</targetPackage>
      <targetVersion>11</targetVersion>
    </configuration>
    <executions>
      <?m2e execute onConfiguration,onIncremental?>
      <execution>
        <goals>
          <goal>generate</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

So what I struggle is to update the version of the dependency:

      <dependency>
        <groupId>xxxx.yaml</groupId>
        <artifactId>annotator</artifactId>
        <version>${project.version}</version>
      </dependency>

=>

      <dependency>
        <groupId>xxxx.yaml</groupId>
        <artifactId>annotator</artifactId>
        <version>feature.xyz</version>
      </dependency>

The PullRequest solved the issue. So kindly please to merge the PR :)

@qoomon
Copy link
Owner

qoomon commented Feb 28, 2025

LGTM, however could you explain why you don't use filterRelatedPlugins(plugins); as I do for all other plugins and dependencies?

@jiri-meluzin
Copy link
Author

Because I need to list all plugins, not only related plugins, then from list of all dependencies get only related dependencies...

@qoomon qoomon merged commit e9d8f25 into qoomon:master Feb 28, 2025
1 check passed
@qoomon
Copy link
Owner

qoomon commented Feb 28, 2025

@jiri-meluzin thanks for your PR version 9.10.1 should be available in some minutes at maven central

@Petrus-Viljoen
Copy link

9.10.1 seems to break silently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants