add-from-repo-maven-plugin

maven plugin for for adding other git repo's sources/tests into this repo while building.

License

License

MIT
Categories

Categories

Maven Build Tools
GroupId

GroupId

com.xenoamess
ArtifactId

ArtifactId

add-from-repo-maven-plugin
Last Version

Last Version

0.0.8
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

add-from-repo-maven-plugin
maven plugin for for adding other git repo's sources/tests into this repo while building.
Project URL

Project URL

https://github.com/XenoAmess/add-from-repo-maven-plugin
Source Code Management

Source Code Management

https://github.com/XenoAmess/add-from-repo-maven-plugin

Download add-from-repo-maven-plugin

How to add to project

<plugin>
    <groupId>com.xenoamess</groupId>
    <artifactId>add-from-repo-maven-plugin</artifactId>
    <version>0.0.8</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.eclipse.jgit : org.eclipse.jgit jar 5.10.0.202012080955-r
org.eclipse.jgit : org.eclipse.jgit.http.server jar 5.10.0.202012080955-r
org.apache.commons : commons-lang3 jar 3.11
commons-io : commons-io jar 2.8.0

provided (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar [3.0.0,4.0.0)
org.apache.maven : maven-core jar [3.0.0,4.0.0)
org.apache.maven : maven-artifact jar [3.0.0,4.0.0)
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

test (3)

Group / Artifact Type Version
org.apache.maven : maven-compat jar [3.0.0,4.0.0)
junit : junit jar 4.13.1
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

add-from-repo-maven-plugin

Maven Central

add-from-repo-maven-plugin, a plugin for adding other git repo's sources/tests into this repo while building.

Goal:

addTestsFromRepo for adding tests from repo. addSourcesFromRepo for adding sources from repo.

Usage:

            <plugin>
                <groupId>com.xenoamess</groupId>
                <artifactId>add-from-repo-maven-plugin</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>addTestsFromRepo</goal>
                        </goals>
                        <configuration>
                            <repoGitUri>https://github.com/apache/commons-crypto</repoGitUri>
                            <relativeDirectory>/src/test</relativeDirectory>
                            <outputDirectory>${project.build.directory}/generated-test-sources/test</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Params:

I will use addTestsFromRepo as example. addSourcesFromRepo is similar actually, so I don't think I need to repeat twice.

All params and their default value are listed here.

   @Parameter(property = "repoGitUri", required = true)
   private String repoGitUri;

   @Parameter(
           defaultValue = "/src/test",
           property = "relativeDirectory",
           required = true
   )
   private String relativeDirectory;

   @Parameter(
           defaultValue = "${project.build.directory}/generated-test-sources/src/test",
           property = "outputDirectory",
           required = true
   )
   private File outputDirectory;

   @Parameter(defaultValue = "${project}")
   private MavenProject project;

repoGitUri means the git repo you want to add 's uri.

relativeDirectory means the folder which you want to add.

outputDirectory means the output dir.

project means your project. I don't think it shall be changed but if you insisted, then you are free to do what you want.

Examples:

Projects using this: https://github.com/XenoAmess/commonx https://github.com/XenoAmess/commons-crypto-smoke-test

Versions

Version
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1