Skip to content

Commit f32a4b1

Browse files
committed
Using DI and SISU
1 parent 46a04d7 commit f32a4b1

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@
199199
</execution>
200200
</executions>
201201
</plugin>
202+
<plugin>
203+
<groupId>org.eclipse.sisu</groupId>
204+
<artifactId>sisu-maven-plugin</artifactId>
205+
<executions>
206+
<execution>
207+
<id>index-project</id>
208+
<goals>
209+
<goal>main-index</goal>
210+
<goal>test-index</goal>
211+
</goals>
212+
</execution>
213+
</executions>
214+
</plugin>
202215
</plugins>
203216
</pluginManagement>
204217

@@ -239,6 +252,10 @@
239252
<groupId>org.apache.maven.plugins</groupId>
240253
<artifactId>maven-source-plugin</artifactId>
241254
</plugin>
255+
<plugin>
256+
<groupId>org.eclipse.sisu</groupId>
257+
<artifactId>sisu-maven-plugin</artifactId>
258+
</plugin>
242259
</plugins>
243260
</build>
244261

src/main/java/io/github/willena/maven/plugins/githooks/CommitFollowConventional.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.github.willena.maven.plugins.githooks;
22

3+
import javax.inject.Named;
4+
import javax.inject.Singleton;
35
import java.nio.file.Files;
46
import java.nio.file.Path;
57
import java.util.regex.Matcher;
@@ -9,6 +11,8 @@
911
* Check if commit message follows the conventional commit format.
1012
* Applicability: commit-msg
1113
*/
14+
@Named("CommitFollowConventional")
15+
@Singleton
1216
public class CommitFollowConventional implements RunnableGitHook {
1317

1418
// Adapted from https://regex101.com/r/vcxVpP/5

src/main/java/io/github/willena/maven/plugins/githooks/CommitReferenceIssue.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.github.willena.maven.plugins.githooks;
22

3+
import javax.inject.Named;
4+
import javax.inject.Singleton;
35
import java.nio.file.Files;
46
import java.nio.file.Path;
57
import java.util.regex.Matcher;
@@ -9,6 +11,8 @@
911
* Check if commit message contains an issue reference.
1012
* Applicability: commit-msg
1113
*/
14+
@Named("CommitReferenceIssue")
15+
@Singleton
1216
public class CommitReferenceIssue implements RunnableGitHook {
1317
private static final Pattern ISSUE_REFERENCE_PATTERN = Pattern.compile("(?<jiraLike>\\b[A-Za-z][A-Za-z0-9_]+-[1-9][0-9]*)|(?<issueId>#\\d+)", Pattern.MULTILINE | Pattern.UNICODE_CHARACTER_CLASS);
1418

src/main/java/io/github/willena/maven/plugins/githooks/Echo.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package io.github.willena.maven.plugins.githooks;
22

33
import org.apache.maven.plugin.logging.Log;
4+
import org.apache.maven.project.MavenProject;
45

6+
import javax.inject.Inject;
7+
import javax.inject.Named;
8+
import javax.inject.Singleton;
59
import java.util.Arrays;
610

711
/**
812
* Hook that prints its inputs
913
* Applicability: any hooks
1014
*/
15+
@Named("Echo")
16+
@Singleton
1117
public class Echo implements RunnableGitHook {
1218

1319
private void log(Log log, String message) {

0 commit comments

Comments
 (0)