-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from avaje/components
Add components.xml/Remove duplicate inject mojo
- Loading branch information
Showing
7 changed files
with
82 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
184 changes: 0 additions & 184 deletions
184
src/main/java/io/avaje/inject/mojo/AutoProvidesMojo.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
src/main/java/io/avaje/inject/mojo/DisableModuleValidationMojo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.avaje.inject.mojo; | ||
|
||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
|
||
import org.apache.maven.plugin.AbstractMojo; | ||
import org.apache.maven.plugin.MojoExecutionException; | ||
import org.apache.maven.plugins.annotations.LifecyclePhase; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
import org.apache.maven.plugins.annotations.ResolutionScope; | ||
import org.apache.maven.project.MavenProject; | ||
|
||
/** Mojo that disables avaje's apt module validation */ | ||
@Mojo( | ||
name = "disable-apt-validation", | ||
defaultPhase = LifecyclePhase.PROCESS_RESOURCES, | ||
requiresDependencyResolution = ResolutionScope.COMPILE) | ||
public class DisableModuleValidationMojo extends AbstractMojo { | ||
|
||
private static final String DISABLING_AVAJE_MODULE_VERIFICATION = | ||
"disabling avaje module verification"; | ||
|
||
@Parameter(defaultValue = "${project}", readonly = true, required = true) | ||
private MavenProject project; | ||
|
||
@Override | ||
public void execute() throws MojoExecutionException { | ||
final var directory = new File(project.getBuild().getDirectory()); | ||
if (!directory.exists()) { | ||
directory.mkdirs(); | ||
} | ||
|
||
try (var flagFile = createFileWriter("avaje-plugin-exists.txt"); ) { | ||
|
||
flagFile.append(DISABLING_AVAJE_MODULE_VERIFICATION); | ||
getLog().info(DISABLING_AVAJE_MODULE_VERIFICATION); | ||
|
||
} catch (final IOException e) { | ||
throw new MojoExecutionException("Failed to write spi classes", e); | ||
} | ||
} | ||
|
||
private FileWriter createFileWriter(String string) throws IOException { | ||
return new FileWriter(new File(project.getBuild().getDirectory(), string)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0"?> | ||
<component-set> | ||
<components> | ||
<component> | ||
<role>org.apache.maven.lifecycle.Lifecycle</role> | ||
<implementation>org.apache.maven.lifecycle.Lifecycle</implementation> | ||
<role-hint>avaje-inject-maven-plugin</role-hint> | ||
<configuration> | ||
<id>avaje-provides-maven-plugin</id> | ||
<phases> | ||
<phase>avaje-inject-maven-plugin-not-used-phase</phase> | ||
</phases> | ||
<default-phases> | ||
<process-resources> | ||
io.avaje:avaje-provides-maven-plugin:${project.version}:disable-apt-validation | ||
</process-resources> | ||
<process-sources> | ||
io.avaje:avaje-inject-maven-plugin:10.0-RC2:provides | ||
</process-sources> | ||
<process-classes> | ||
io.avaje:avaje-provides-maven-plugin:${project.version}:add-module-spi | ||
</process-classes> | ||
</default-phases> | ||
</configuration> | ||
</component> | ||
</components> | ||
</component-set> |