Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
d9d9292c
Commit
d9d9292c
authored
Aug 25, 2016
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Third-party license information
parent
b43847c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
1 deletion
+85
-1
pom.xml
pom.xml
+31
-1
src/test/java/org/genesys2/server/test/LicensesTest.java
src/test/java/org/genesys2/server/test/LicensesTest.java
+54
-0
No files found.
pom.xml
View file @
d9d9292c
...
...
@@ -15,7 +15,9 @@
limitations under the License.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.genesys-pgr
</groupId>
...
...
@@ -720,6 +722,30 @@
</attributes>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
license-maven-plugin
</artifactId>
<version>
1.9
</version>
<executions>
<execution>
<id>
license-download
</id>
<phase>
generate-resources
</phase>
<goals>
<goal>
download-licenses
</goal>
</goals>
</execution>
<execution>
<id>
license-third-party
</id>
<phase>
generate-sources
</phase>
<goals>
<goal>
add-third-party
</goal>
</goals>
</execution>
</executions>
<configuration>
<sortArtifactByName>
true
</sortArtifactByName>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
...
...
@@ -733,6 +759,10 @@
</includes>
<filtering>
true
</filtering>
</resource>
<resource>
<directory>
${project.build.directory}/generated-resources
</directory>
<filtering>
false
</filtering>
</resource>
</resources>
<pluginManagement>
<plugins>
...
...
src/test/java/org/genesys2/server/test/LicensesTest.java
0 → 100644
View file @
d9d9292c
/*
* Copyright 2016 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* 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.
*/
package
org.genesys2.server.test
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
junit
.
Assert
.*;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.charset.Charset
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.apache.commons.io.IOUtils
;
import
org.junit.Test
;
public
class
LicensesTest
{
@Test
public
void
test3rdPartyRead
()
throws
IOException
{
try
(
InputStream
is
=
getClass
().
getClassLoader
().
getResourceAsStream
(
"THIRD-PARTY.txt"
))
{
String
thirdParty
=
IOUtils
.
toString
(
is
,
Charset
.
forName
(
"UTF8"
));
assertThat
(
"THIRD-PARTY.txt could not be read"
,
thirdParty
,
not
(
nullValue
()));
Pattern
licenseInfo
=
Pattern
.
compile
(
"^ {5}\\(((?:\\([^\\)]+\\)|[^\\)])+)\\) (\\(.+\\) )*(.+) \\((.+):(.+):(.+) \\- (.+)\\)$"
,
Pattern
.
MULTILINE
);
Matcher
m
=
licenseInfo
.
matcher
(
thirdParty
);
while
(
m
.
find
())
{
String
license
=
m
.
group
(
1
);
String
license2
=
m
.
group
(
2
);
String
project
=
m
.
group
(
3
);
String
groupId
=
m
.
group
(
4
);
String
artifactId
=
m
.
group
(
5
);
String
version
=
m
.
group
(
6
);
String
url
=
m
.
group
(
7
);
System
.
err
.
println
(
project
+
" url="
+
url
+
" license="
+
license
+
" art="
+
artifactId
+
"@"
+
version
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment