Skip to content
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

Support pluggable Git integration #20

Closed
Tracked by #16
tisonkun opened this issue Jan 5, 2023 · 2 comments · Fixed by #102
Closed
Tracked by #16

Support pluggable Git integration #20

tisonkun opened this issue Jan 5, 2023 · 2 comments · Fixed by #102
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tisonkun
Copy link
Member

tisonkun commented Jan 5, 2023

license-maven-plugin has a pluggable Git integration license-maven-plugin-git.

We can have a similar plugin to populate Git-related information like first commit time, last commit time and excludes from .gitignore rules, etc.

It will require a plugin strategy and perhaps dynamically loaded. But in the native image and command line fat jar, we may bundle them. I'm unsure now.

For Git interoperation library, jgit is a good choice: https://www.eclipse.org/jgit/

@tisonkun tisonkun mentioned this issue Jan 5, 2023
20 tasks
@tisonkun tisonkun added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 5, 2023
@spencercjh
Copy link

More details:

license-maven-plugin-git is a jar which will be added to the dependencies of the plugin.

<plugin>
    <groupId>com.mycila</groupId>
    <artifactId>license-maven-plugin</artifactId>
    <version>${license-maven-plugin.version}</version>
    <configuration>
      <header>my-header-folder/my-header-template.txt</header>
     ...
    </configuration>
    <dependencies>
      <dependency>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin-fs</artifactId>
        <!-- make sure you use the same version as license-maven-plugin -->
        <version>${license-maven-plugin.version}</version>
      </dependency>
    </dependencies>
    <executions>
      ...
    </executions>
</plugin>

It implements the interface PropertiesProvider and will be loaded here

for (final PropertiesProvider provider : ServiceLoader.load(PropertiesProvider.class,
    Thread.currentThread().getContextClassLoader())) {
  provider.init(this, globalProperties);
  propertiesProviders.add(provider);
}

@tisonkun
Copy link
Member Author

tisonkun commented Aug 30, 2023

Yes. Another important improvement is filtering out files that ignored by .gitignore file.

But for this purpose we may firstly factor out the Selection logics to support file filter SPIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants