forked from strongbox/strongbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 1723: Make it possible to specify the license types of test art…
…ifacts Issue 1724: Make it possible to specify the license types of Maven test artifacts
- Loading branch information
1 parent
f773842
commit ac7fd83
Showing
17 changed files
with
2,645 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ox-storage-api/src/test/java/org/carlspring/strongbox/testing/artifact/LicenseConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.carlspring.strongbox.testing.artifact; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* This annotation helps configure license details for test artifacts. | ||
* | ||
* @author carlspring | ||
*/ | ||
@Target({ ElementType.PARAMETER, ElementType.ANNOTATION_TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface LicenseConfig | ||
{ | ||
|
||
LicenseType license() default LicenseType.NONE; | ||
|
||
String destinationPath() default "LICENSE"; | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
...gbox-storage-api/src/test/java/org/carlspring/strongbox/testing/artifact/LicenseType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package org.carlspring.strongbox.testing.artifact; | ||
|
||
/** | ||
* This class contains some common licenses that can be used when generating test artifacts. | ||
* | ||
* @author carlspring | ||
*/ | ||
public enum LicenseType | ||
{ | ||
|
||
APACHE_2_0("Apache 2.0", "apache-2.0", "http://www.apache.org/licenses/LICENSE-2.0"), | ||
|
||
AGPL_3_0("GNU Affero General Public License", "agpl-3.0", "https://www.gnu.org/licenses/agpl-3.0.en.html"), | ||
|
||
BSL_1_0("Boost Software License 1.0", "bsl-1.0", "https://www.boost.org/users/license.html"), | ||
|
||
EPL_2_0("Eclipse Public License 2.0", "epl-1.0", "https://www.eclipse.org/legal/epl-2.0/"), | ||
|
||
GPL_3_0("GNU General Public License", "gpl-3.0", "https://www.gnu.org/licenses/gpl-3.0.en.html"), | ||
|
||
LGPL_3_0("GNU Lesser General Public License version 3", "lgpl-3.0", "https://www.gnu.org/licenses/lgpl-3.0.en.html"), | ||
|
||
MIT("MIT License", "mit", "https://opensource.org/licenses/MIT"), | ||
|
||
MPL_2_0("Mozilla Public License Version 2.0", "mpl", "https://www.mozilla.org/en-US/MPL/2.0/"), | ||
|
||
UNLICENSE("Unlicense", "unlicense", "https://unlicense.org/"), | ||
|
||
NONE(null, null, null); | ||
|
||
private String name; | ||
|
||
private String shortName; | ||
|
||
private String url; | ||
|
||
|
||
LicenseType(String name, String shortName, String url) | ||
{ | ||
this.name = name; | ||
this.shortName = shortName; | ||
this.url = url; | ||
} | ||
|
||
public String getName() | ||
{ | ||
return name; | ||
} | ||
|
||
public String getShortName() | ||
{ | ||
return shortName; | ||
} | ||
|
||
public String getUrl() | ||
{ | ||
return url; | ||
} | ||
|
||
public String getLicenseFileSourcePath() | ||
{ | ||
return "licenses/" + shortName + "/LICENSE.md"; | ||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
strongbox-storage/strongbox-storage-api/src/test/resources/licenses/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
These licenses are only for the use with test generated artifacts. | ||
They are not a replacement of the Strongbox project's license in any way. |
Oops, something went wrong.