Skip to content

Commit

Permalink
Merge pull request #2 from deviceinsight/feature/travis-ci
Browse files Browse the repository at this point in the history
Feature/travis ci
  • Loading branch information
pvorb authored Jul 16, 2020
2 parents 6407e15 + 8dd9fc4 commit f8f7709
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 14 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dist: bionic

language: java

jdk:
- openjdk8

cache:
directories:
- $HOME/.m2

env:
- MAVEN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true"
- MAVEN_CLI_OPTS="--batch-mode --errors --fail-at-end --show-version"

install: "/bin/true"

script:
- mvn $MAVEN_CLI_OPTS clean verify
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Initial version of the dependency-license-exporter

[Unreleased]: https://github.com/deviceinsight/dependency-license-exporter
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dependency-license-exporter

this repo is a small maven project which generates a `jar` to place config files on the classpath
This repo is a small maven project which generates a `jar` to place config files on the classpath
when generating dependency license information using [License Maven Plugin](https://www.mojohaus.org/license-maven-plugin/).
These config files allows for a generated license list that matches the company requirements.

Expand Down Expand Up @@ -70,17 +70,17 @@ now run the following command and a file `dependencies-license.adoc` should be g
mvn clean generate-resources -Pcreate-license-list
```

## Analysing the output
## Analysing the Output

### Overriding found licenses
### Overriding Found Licenses

If [License Maven Plugin](https://www.mojohaus.org/license-maven-plugin/) determines a license for a dependency but the
license is incorrect or not specific enough, we can override it:

In this repo we maintain file with license overrides (`src/main/resources/override-licenses.txt`) where license information can be added.
this file is loaded via `overrideUrl` configuration in the profile above.

#### file format
#### File Format

```text
${mavenGroupId}--${mavenArtifactId}--${version}=${license}
Expand Down Expand Up @@ -109,7 +109,7 @@ Dependencies might declare the name of the same license in different ways e.g. (
to consolidate the used licenses different names can be merged into one using the file `src/main/resources/license-merges.txt`
which is loaded via `licenseMergesUrl` configuration in the profile above.

#### file format
#### File Format

```text
${spdx identifier}|${license spelling A}|${license spelling B}|${license spelling C}
Expand All @@ -126,3 +126,31 @@ to the license description.

There are two different goals: `add-third-party` and `aggregate-add-third-party`. With `add-third-party` the dependency file is created for each module.
If only one dependency file in a multi module project should be generated, the `aggregate-add-third-party` goal can be used.

## Releasing

Creating a new release involves the following steps:

* `mvn gitflow:release-start gitflow:release-finish`
* `git push origin master`
* `git push --tags`
* `git push origin develop`

In order to deploy the release to Maven Central, you need to create an account at https://issues.sonatype.org and
configure your account in `~/.m2/settings.xml`:

``` xml
<settings>
<servers>
<server>
<id>ossrh</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
</servers>
</settings>
```

The account also needs access to the project on Maven Central. This can be requested by another project member.

Then check out the release you want to deploy (`git checkout x.y.z`) and run `mvn deploy -Prelease`.
143 changes: 135 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,142 @@

<groupId>com.deviceinsight</groupId>
<artifactId>dependency-license-exporter</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Dependency License Exporter</name>
<description>Generates a license list of all dependencies used in the project.</description>
<url>https://github.com/deviceinsight/dependency-license-exporter</url>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub DEVICEINSIGHT Apache Maven Packages</name>
<url>https://maven.pkg.github.com/deviceinsight/dependency-license-exporter</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<gitflow-maven-plugin.version>1.14.0</gitflow-maven-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.1.0</maven-javadoc-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
</properties>


<organization>
<name>Device Insight GmbH</name>
<url>https://device-insight.com</url>
</organization>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>

<developers>
<developer>
<id>pvorb</id>
<name>Paul Vorbach</name>
<email>[email protected]</email>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/deviceinsight/dependency-license-exporter.git</connection>
<developerConnection>scm:git:ssh://[email protected]:deviceinsight/dependency-license-exporter.git
</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/deviceinsight/dependency-license-exporter.git</url>
</scm>

<build>
<plugins>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>${gitflow-maven-plugin.version}</version>
<configuration>
<pushRemote>false</pushRemote>
<versionDigitToIncrement>1</versionDigitToIncrement>
<useSnapshotInHotfix>true</useSnapshotInHotfix>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>

<build>
<plugins>
<!-- To generate javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- To release to Maven central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!-- To sign the artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

</profile>
</profiles>
</project>

0 comments on commit f8f7709

Please sign in to comment.