Skip to content

Commit

Permalink
Copyright travis job improved (#365)
Browse files Browse the repository at this point in the history
* Copyright plugin version fix.
Printing of incorrect copyrights improved.

Signed-off-by: David Kral <david.k.kral@oracle.com>

* Suggestions of aguibert according to copyright implemented.

Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent authored and aguibert committed Nov 25, 2019
1 parent d51df64 commit 3ce1e66
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ install: true

jobs:
include:
- stage: checkstyle
script: mvn checkstyle:checkstyle
- stage: copyright
script: bash etc/copyright.sh
- stage: install-yasson
script: mvn -U -C -Pstaging clean install
# - stage: run-jmh
# script:
# - cd yasson-jmh
# - mvn clean install
# - java -jar target/yasson-jmh.jar -t 1 -f 2
- stage: checkstyle
script: mvn checkstyle:checkstyle
- stage: copyright
script: mvn glassfish-copyright:check
- stage: tck-run
script: bash tck.sh
script: bash etc/tck.sh


22 changes: 22 additions & 0 deletions etc/copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -x
#
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0,
# or the Eclipse Distribution License v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

die(){ echo "${1}" ; exit 1 ;}

readonly RESULT_FILE="copyright-check.txt"

mvn -q org.glassfish.copyright:glassfish-copyright-maven-plugin:copyright \
> ${RESULT_FILE} || (cat ${RESULT_FILE}; die "Error running the Maven command")

grep -i "copyright" ${RESULT_FILE} \
&& die "COPYRIGHT ERROR" || echo "COPYRIGHT OK"
0 tck.sh → etc/tck.sh
100755 → 100644
File renamed without changes.
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,18 @@
<groupId>org.glassfish.copyright</groupId>
<artifactId>glassfish-copyright-maven-plugin</artifactId>
<executions>
<!--Copyright goal does not fail when copyright is not properly updated,
but prints out which file has incorrect copyright.-->
<execution>
<id>run-copyright</id>
<id>print-copyright</id>
<goals>
<goal>copyright</goal>
</goals>
<phase>validate</phase>
</execution>
<!--Check goal does not print out incorrect copyright files, but fails when there are errors.-->
<execution>
<id>check-copyright</id>
<goals>
<goal>check</goal>
</goals>
Expand Down Expand Up @@ -510,7 +520,7 @@
<plugin>
<groupId>org.glassfish.copyright</groupId>
<artifactId>glassfish-copyright-maven-plugin</artifactId>
<version>2.2</version>
<version>2.3</version>
<configuration>
<templateFile>etc/copyright.txt</templateFile>
<excludeFile>etc/copyright-exclude.txt</excludeFile>
Expand Down

0 comments on commit 3ce1e66

Please sign in to comment.