Giter Site home page Giter Site logo

attribution-maven-plugin's Introduction

Attribution Maven Plugin

Maven Central

Javadocs

The Attribution Maven Plugin is a tool for producing information about a project's dependencies, in a way that can be consumed by external reporting tools. It currently leverages the Maven Project Info Reports Plugin (https://maven.apache.org/components/plugins/maven-project-info-reports-plugin/) to obtain all of a project's data, and then outputs the information to an XML file, such as: target/attribution.xml.

This plugin came out of the need to get some of the same information produced by the Maven Project Info Reports Plugin, and have it transformed, ready to be consumed by tools which may require input in a certain format, such as a CSV. By producing an attribution XML file, scripts can be created to translate the data into these other consumable formats.

Configuration

  • outputFile
    • Location of the output attribution XML file (defaults to target/attribution.xml)
  • forceRegeneration
    • Whether or not regeneration of the attribution.xml file should be forced (defaults to false). Normally, if the plugin detects the timestamp of the attribution.xml file is later than the project's pom.xml file, it will not go through the process of regenerating it. This parameter will cause it to be regenerated, regardless of file timestamps.
  • dependencyOverrides
    • Provides one or more <dependencyOverride> elements, which allow you to override values placed in the final attribution.xml file. This feature is handy when for some reason a dependency doesn't contain certain pieces of information in its pom. See the example below for how this is specified.
  • skipDownloadUrl
    • This flag allows to skip the retrieval of the downloadUrl info (defaults to false). It can highly reduce the run time of the plugin if this info is not relevant as this part is quite time consuming.
  • includeTransitiveDependencies
    • Whether or not transitive dependencies should be included in the report (defaults to true). Setting it to false will include only the project dependencies.
  • threads
    • Number of concurrent thread tasks used to resolve the maven dependencies (defaults to 10).
  • skip
    • If true, no action will take place by the plugin (defaults to false).

Example

<plugin>
    <groupId>com.github.jinnovations</groupId>
    <artifactId>attribution-maven-plugin</artifactId>
    <version>${attribution-maven-plugin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>generate-attribution-file</goal>
            </goals>
            <phase>generate-resources</phase>
        </execution>
    </executions>
    <configuration>
        <outputFile>${project.build.directory}/attribution.xml</outputFile>
        <dependencyOverrides>
            <dependencyOverride>
                <forDependency>org.apache.axis:axis</forDependency>
                <projectUrl>https://axis.apache.org/axis/</projectUrl>
                <license>
                    <name>Apache License, Version 2.0</name>
                    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
                </license>
            </dependencyOverride>
            <dependencyOverride>
                <forDependency>net.iharder:base64</forDependency>
                <license>
                    <name>Public Domain (any license you desire)</name>
                    <url>http://iharder.sourceforge.net/current/java/base64/</url>
                </license>
            </dependencyOverride>
            <dependencyOverride>
                <forDependency>javax.xml:jaxrpc-api</forDependency>
                <projectUrl>https://java.net/projects/jax-rpc/</projectUrl>
                <license>
                    <name>CDDL-1.0</name>
                    <url>https://opensource.org/licenses/cddl1.php</url>
                </license>
            </dependencyOverride>
            <dependencyOverride>
                <forDependency>org.hamcrest:hamcrest-core</forDependency>
                <projectUrl>http://hamcrest.org/JavaHamcrest/</projectUrl>
            </dependencyOverride>
        </dependencyOverrides>
    </configuration>
</plugin>

attribution-maven-plugin's People

Contributors

blievens avatar jalbr74 avatar jrivard avatar rbarbey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

attribution-maven-plugin's Issues

Wont create target folder

When using the plugin outside of a maven lifecycle that creates the target folder the plugin fails

Strange PKIX SSL issue

When using the plugin (and a 3rd party artifactory) I get strange error with PKIX despite having the certificate in the system.

See error below
[WARNING] Failure to transfer com.xxxx:integration-jaxrs-filter-tlheaders:1.0.2-SNAPSHOT/maven-metadata.xml from https://a/b was cached in the local repository, resolution will not be reattempted until the update interval of artifactory-legacy has elapsed or updates are forced. Original error: Could not transfer metadata com.xxxx:integration-jaxrs-filter-tlheaders:1.0.2-SNAPSHOT/maven-metadata.xml from/to artifactory-legacy (https://a/b): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Project status and future contributions

Thanks for this very useful plugin!

Is the project still being maintained and would it be possible to submit new pull requests?

I would like to add a few features to the plugin, but at the moment the lack of a license would prevent me from contributing. Can something also be done in that regard?

Include test dependencies

Thanks a lot for this nice plugin!

Would it be possible to also include test dependencies?
In order to be compliant with all licenses, we would like to list all dependencies including their license. To do so it would be great if this plugin could also list the test and plugin dependencies.

Fetch source URLs

Hi,

conforming with some open source licenses requires providing a link to the source code alongside the license.

Hence it would be helpful to be able to fetch the source jars urls alongside the bytecode urls, and to make them part of the <downloadUrls>.

Regards.

NPE when executing plugin within Eclipse / m2e

When using the Maven builder within Eclipse, I get the following error:

Failed to execute mojo com.github.jinnovations:attribution-maven-plugin:0.9.9:generate-attribution-file {execution: default} (com.github.jinnovations:attribution-maven-plugin:0.9.9:generate-attribution-file:default:generate-resources)

org.eclipse.core.runtime.CoreException: Failed to execute mojo com.github.jinnovations:attribution-maven-plugin:0.9.9:generate-attribution-file {execution: default}
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:340)
[...cut...]

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.github.jinnovations:attribution-maven-plugin:0.9.9:generate-attribution-file failed: Cannot invoke "Object.getClass()" because "object" is null
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:338)
	... 32 more
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "object" is null
	at org.apache.maven.shared.dependency.graph.internal.Invoker.invoke(Invoker.java:39)
	at org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder.buildDependencyGraph(Maven31DependencyGraphBuilder.java:99)
	at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:91)
	at org.apache.maven.shared.dependency.graph.internal.DefaultDependencyGraphBuilder.buildDependencyGraph(DefaultDependencyGraphBuilder.java:66)
	at com.microfocus.plugins.attribution.datamodel.services.impl.DependenciesServiceImpl.resolveProject(DependenciesServiceImpl.java:250)
	at com.microfocus.plugins.attribution.datamodel.services.impl.DependenciesServiceImpl.getProjectDependencies(DependenciesServiceImpl.java:75)
	at com.microfocus.plugins.attribution.mojos.AttributionMojo.execute(AttributionMojo.java:89)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
	... 33 more

When using the same project file from either a launch configuration or the command line, the error does not appear.

Does not work with Java 11

Seems that the plugin requires javax.xml.bind package that is not a part of default distribution anymore.
//Sorry, that was a misteak. Please remove that issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.