intermediates) throws ExecutionException;
25 |
26 | public WorkflowStepResult postProcessResult(WorkflowStepResult result) {
27 | return result;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/example-projects/p2-example-project/src/antennaconf.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | SomeBundle
19 |
20 |
21 | EPL 2.0
22 |
23 |
24 | false
25 | EXACT
26 | Copyright 2019 Some Very Arbitrary Guy
27 |
28 | some_bundle
29 | 0.0.1.201902181544
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/assembly/compliance-tool/src/site/markdown/exporter.md:
--------------------------------------------------------------------------------
1 | ## SW360 Exporter
2 |
3 | The SW360 Exporter requests all components from a given SW360 instance
4 | and filters the releases of the components to check if they have a state
5 | that shows them as "cleared" or "approved".
6 | It then creates a list with the data of non-cleared releases and writes them
7 | sorted by creation date (from latest to oldest) in a csv file.
8 |
9 | The csv file follows the csv format accepted by the [CSV Analyzer](../analyzers/csv-analyzer-step.html).
10 |
11 | Should there already be a csv file of the same name in the target directory,
12 | the SW360 Exporter will overwrite it.
13 |
14 | ### Properties
15 | Sources specific properties:
16 |
17 | - `sourcesDirectory`: Directory where the sources downloaded are stored
18 | - `removeUnreferencedSources`: A boolean property that controls whether the exporter should do some cleanup on the sources directory. If set to *true*, the exporter checks after the download of sources whether the directory contains any files that are not referenced by any of the components that have been written to the CSV file. Such files are then removed, so that the directory contains only the sources of components that are currently in focus. The default value of this flag if *false*.
--------------------------------------------------------------------------------
/core/core-workflow-steps/src/test/resources/CsvAnalyzerTest/dependencies.csv:
--------------------------------------------------------------------------------
1 | Artifact Id,Group Id,Version,Coordinate Type,Effective License,Declared License,Observed License,Copyrights,Hash,Source URL,Release Tag URL,Software Heritage ID,Clearing State,Clearing Document,Change Status,CPE,File Name
2 | commons-csv,org.apache.commons,1.4,mvn,Apache-2.0,Apache-2.0,Apache-2.0 OR MIT,Copyright 2005-2016 The Apache Software Foundation,620580a88953cbcf4528459e485054e7c27c0889,http://archive.apache.org/dist/commons/csv/source/commons-csv-1.4-src.zip,https://github.com/apache/commons-csv/tree/csv-1.4,swh:1:cnt:60dbac0aafd98c9ca461256a0cefd8a7aaea8bda,OSM_APPROVED,CsvAnalyzerTest/clearing.json,AS_IS,cpe:2.3:a:apache:commons-csv:1.4,
3 | commons-cli,org.apache.commons,1.4,maven,Apache-2.0,Apache-2.0,,Copyright 2005-2016 The Apache Software Foundation,2a26e60c745cdeb99a96f21adec508f43b5d25a5,http://archive.apache.org/dist/commons/cli/source/commons-cli-1.4-src.zip,https://github.com/apache/commons-cli/tree/cli-1.4,swh:1:cnt:fb91f0e6b0e7b2f89fe5e1a2b1b375775e4839d4,OSM_APPROVED,non-existing-clearing.json,AS_IS,cpe:2.3:a:apache:commons-cli:1.4,commons-cli.jar
4 | testNuget,,1.0,nuget,,,,,,,,,,,,,
5 | testDotNet,,1.0,dotnet,,,,,,,,,,,,,
6 | testNpm,test,1.0,npm,,,,,,,,,,,,,
7 | testbundle ,,1.0,bundle,,,,,,,,,,,,,
8 | testPython,,1.0,PYPI,,,,,,,,,,,,,
9 |
--------------------------------------------------------------------------------
/http-support/src/main/java/org/eclipse/sw360/antenna/http/HttpClientFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch.IO GmbH 2020.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.http;
12 |
13 | import org.eclipse.sw360.antenna.http.config.HttpClientConfig;
14 |
15 | /**
16 | *
17 | * Definition of an interface that allows the creation of an {@link HttpClient}
18 | * object.
19 | *
20 | *
21 | * This interface defines a factory method that can be used to create new,
22 | * fully configured instances of {@link HttpClient}. The new instances are
23 | * created based on a configuration object.
24 | *
25 | */
26 | public interface HttpClientFactory {
27 | /**
28 | * Creates a new instance of {@code HttpClient} and configures it
29 | * according to the passed in configuration object.
30 | *
31 | * @param config the configuration for the new client
32 | * @return the new {@code HttpClient} instance
33 | */
34 | HttpClient newHttpClient(HttpClientConfig config);
35 | }
36 |
--------------------------------------------------------------------------------
/modules/policy/engine-testing/src/test/resources/features/T2_CheckDifferentCoordinates.feature:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) Bosch Software Innovations GmbH 2019.
3 | #
4 | # All rights reserved. This program and the accompanying materials
5 | # are made available under the terms of the Eclipse Public License v1.0
6 | # which accompanies this distribution, and is available at
7 | # http://www.eclipse.org/legal/epl-v20.html
8 | #
9 | # SPDX-License-Identifier: EPL-2.0
10 | #
11 |
12 | Feature: Check Multiple Coordinate Types
13 | In this test we do not allow components from different technologies in the same project
14 |
15 | Scenario: Artifacts from different technologies fail
16 | Given an artifact called "Maven" with
17 | | coordinates | pkg:maven/com.something/foo@1.0.0 |
18 | And an artifact called "Nuget" with
19 | | coordinates | pkg:nuget/bar@2.3.1 |
20 | When I use the rule "T2"
21 | Then all artifacts fail with policy id "T2"
22 |
23 | Scenario: Artifacts from same technology succeed
24 | Given an artifact called "Maven" with
25 | | coordinates | pkg:maven/com.something/foo@1.0.0 |
26 | And an artifact called "Maven2" with
27 | | coordinates | pkg:maven/com.something/bar@2.3.1 |
28 | When I use the rule "T2"
29 | Then no artifact fails
30 |
31 |
32 |
--------------------------------------------------------------------------------
/modules/policy/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
16 | 4.0.0
17 |
18 |
19 | org.eclipse.sw360.antenna
20 | antenna-management
21 | ${revision}
22 | ../../
23 |
24 |
25 | policy-module
26 | policy-module
27 |
28 | pom
29 |
30 |
31 | engine
32 | engine-testing
33 | basic-policies
34 |
35 |
36 |
--------------------------------------------------------------------------------
/antenna-documentation/Jenkinsfile.eclipse.documentation:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2020.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | /*
13 | * This is an additional Jenkinsfile, for building the documentation
14 | * with the GitHub site-maven-plugin within the Eclipse Foundation infrastructure
15 | */
16 |
17 | pipeline {
18 | agent any
19 |
20 | tools {
21 | maven 'apache-maven-latest'
22 | jdk 'adoptopenjdk-hotspot-jdk8-latest'
23 | }
24 |
25 | environment {
26 | GITHUB_CREDENTIALS = credentials('github-bot')
27 | }
28 | stages {
29 | stage('Configure Git') {
30 | steps {
31 | sh 'git config --global user.name "${GITHUB_CREDENTIALS_USR}"'
32 | sh 'git config --global user.email "${GITHUB_CREDENTIALS_USR}@eclipse.org"'
33 | }
34 | }
35 | stage('Site Deploy') {
36 | steps {
37 | sh 'antenna-documentation/scripts/main.sh'
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/assembly/pom.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | 4.0.0
16 |
17 |
18 | antenna-management
19 | org.eclipse.sw360.antenna
20 | ${revision}
21 |
22 |
23 | assembly
24 | pom
25 | Antenna assembly
26 |
27 |
28 | compliance-tool
29 | configuration
30 | cli
31 | maven-plugin
32 | gradle-plugin
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/modules/policy/basic-policies/src/test/resources/features/SWHSourceIdKnownRule.feature:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) Bosch Software Innovations GmbH 2019.
3 | #
4 | # All rights reserved. This program and the accompanying materials
5 | # are made available under the terms of the Eclipse Public License v1.0
6 | # which accompanies this distribution, and is available at
7 | # http://www.eclipse.org/legal/epl-v20.html
8 | #
9 | # SPDX-License-Identifier: EPL-2.0
10 | #
11 |
12 | Feature: Software Heritage link available
13 | Artifacts should have a link to the sources on software heritage.
14 |
15 | Scenario: Artifact without Software Heritage information fails the rule
16 | Given an artifact
17 | When I use the rule "SWHAvailable"
18 | Then the artifact should fail with policy id "SWHAvailable"
19 |
20 | Scenario: Proprietary artifact passes the rule
21 | Given an artifact with
22 | | proprietary | true |
23 | When I use the rule "SWHAvailable"
24 | Then no artifact fails on policy id "SWHAvailable"
25 |
26 | Scenario: Artifact with Software Heritage information pass the rule
27 | Given an artifact with
28 | | sources | swh:1:rel:22ece559cc7cc2364edc5e5593d63ae8bd229f9f |
29 | When I use the rule "SWHAvailable"
30 | Then no artifact fails on policy id "SWHAvailable"
31 |
--------------------------------------------------------------------------------
/modules/policy/engine/src/main/java/org/eclipse/sw360/antenna/policy/engine/CompareArtifactRule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2019.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.policy.engine;
12 |
13 | import org.eclipse.sw360.antenna.policy.engine.model.ThirdPartyArtifact;
14 |
15 | import java.util.Optional;
16 |
17 | /**
18 | * {@link Rule} type that iterates through all {@link ThirdPartyArtifact} objects and allows to compare properties
19 | * of the artifact to the property of all other artifacts
20 | */
21 | public interface CompareArtifactRule extends Rule {
22 | /**
23 | * @param leftArtifact Left side {@link ThirdPartyArtifact} of the comparison
24 | * @param rightArtifact Right side {@link ThirdPartyArtifact} of the comparison
25 | * @return {@link PolicyViolation} as {@link Optional}, if a policy violation is found an empty Optional if not
26 | */
27 | Optional evaluate(ThirdPartyArtifact leftArtifact, ThirdPartyArtifact rightArtifact);
28 | }
29 |
--------------------------------------------------------------------------------
/assembly/compliance-tool/src/main/java/org/eclipse/sw360/antenna/frontend/compliancetool/sw360/reporter/ReporterOutputFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch.IO GmbH 2020.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.frontend.compliancetool.sw360.reporter;
12 |
13 | /**
14 | * Factory class for creating a {@link ReporterOutput} implementation
15 | */
16 | class ReporterOutputFactory {
17 | static final ReporterOutput DEFAULT_REPORTER_OUTPUT = new ReporterOutputCSV();
18 |
19 | private ReporterOutputFactory() {}
20 |
21 | /**
22 | * create function to create an object implementing the {@link ReporterOutput}
23 | *
24 | * @param outputFormat String representation of the type of the object
25 | * @return {@link ReporterOutput} of the output format
26 | */
27 | static ReporterOutput getReporterOutput(String outputFormat) {
28 | if (outputFormat.equalsIgnoreCase("csv")) {
29 | return new ReporterOutputCSV();
30 | }
31 | return DEFAULT_REPORTER_OUTPUT;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/modules/sw360/sw360-client/src/main/java/org/eclipse/sw360/antenna/sw360/client/rest/resource/SW360Visibility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2017-2018.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | package org.eclipse.sw360.antenna.sw360.client.rest.resource;
13 |
14 | public enum SW360Visibility {
15 | PRIVATE(0), ME_AND_MODERATORS(1), BUISNESSUNIT_AND_MODERATORS(2), EVERYONE(3);
16 |
17 | private final int value;
18 |
19 | SW360Visibility(int value) {
20 | this.value = value;
21 | }
22 |
23 | public int getValue() {
24 | return this.value;
25 | }
26 |
27 | public static SW360Visibility findByValue(int value) {
28 | switch (value) {
29 | case 0:
30 | return PRIVATE;
31 | case 1:
32 | return ME_AND_MODERATORS;
33 | case 2:
34 | return BUISNESSUNIT_AND_MODERATORS;
35 | case 3:
36 | return EVERYONE;
37 | default:
38 | return null;
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/example-projects/p2-example-tycho-project/antennaconf.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | SomeBundle
19 |
20 |
21 | EPL 2.0
22 |
23 |
24 | false
25 | EXACT
26 | Copyright 2019 Some Very Arbitrary Guy
27 |
28 | some_bundle
29 | 0.0.1.201904011221
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/modules/policy/engine/src/main/java/org/eclipse/sw360/antenna/policy/engine/Rule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2019.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.policy.engine;
12 |
13 | /**
14 | * Interface for a generic rule with the standard fields relevant for all policy rules.
15 | */
16 | public interface Rule {
17 | /**
18 | * @return The business id of the rule defined by the policy responsible
19 | */
20 | String getId();
21 |
22 | /**
23 | * @return The business getName of the rule defined by the policy responsible
24 | */
25 | String getName();
26 |
27 | /**
28 | * @return The description given to the user of the policy in case of a policy violation
29 | */
30 | String getDescription();
31 |
32 | /**
33 | * @return The configured severity of a policy violation
34 | */
35 | RuleSeverity getSeverity();
36 |
37 | /**
38 | * @return The associated {@link Ruleset} from which the rule originates
39 | */
40 | Ruleset getRuleset();
41 | }
42 |
--------------------------------------------------------------------------------
/core/model/src/test/java/org/eclipse/sw360/antenna/model/license/LicenseComparatorTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2013,2016-2017.
3 | * Copyright (c) Bosch.IO GmbH 2020.
4 | *
5 | * All rights reserved. This program and the accompanying materials
6 | * are made available under the terms of the Eclipse Public License v2.0
7 | * which accompanies this distribution, and is available at
8 | * http://www.eclipse.org/legal/epl-v20.html
9 | *
10 | * SPDX-License-Identifier: EPL-2.0
11 | */
12 | package org.eclipse.sw360.antenna.model.license;
13 |
14 | import org.eclipse.sw360.antenna.model.util.LicenseComparator;
15 | import org.junit.Test;
16 |
17 | import static org.assertj.core.api.Assertions.assertThat;
18 |
19 | public class LicenseComparatorTest {
20 |
21 | @Test
22 | public void testCompare() {
23 | License license = new License();
24 | license.setId("EPL-1.0");
25 | license.setText("");
26 | License compareLicense = new License();
27 | compareLicense.setId("a");
28 | LicenseComparator comparator = new LicenseComparator();
29 | assertThat(comparator.compare(license, license)).isEqualTo(0);
30 | assertThat(comparator.compare(compareLicense, license)).isPositive();
31 | assertThat(comparator.compare(license, compareLicense)).isNegative();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/core/model/src/test/java/org/eclipse/sw360/antenna/model/license/LicenseOperatorTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch.IO GmbH 2020.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.model.license;
12 |
13 | import org.junit.Test;
14 |
15 | import static org.assertj.core.api.Assertions.assertThat;
16 |
17 | public class LicenseOperatorTest {
18 | @Test
19 | public void testLicenseOperator() {
20 | assertThat(LicenseOperator.fromValue("and"))
21 | .isEqualTo(LicenseOperator.AND);
22 | assertThat(LicenseOperator.fromValue("And"))
23 | .isEqualTo(LicenseOperator.AND);
24 | assertThat(LicenseOperator.fromValue("AND"))
25 | .isEqualTo(LicenseOperator.AND);
26 |
27 | assertThat(LicenseOperator.fromValue("or"))
28 | .isEqualTo(LicenseOperator.OR);
29 | assertThat(LicenseOperator.fromValue("Or"))
30 | .isEqualTo(LicenseOperator.OR);
31 | assertThat(LicenseOperator.fromValue("OR"))
32 | .isEqualTo(LicenseOperator.OR);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/modules/sw360/sw360-client/src/test/java/org/eclipse/sw360/antenna/sw360/client/rest/resource/attachments/SW360AttachmentTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2019.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.sw360.client.rest.resource.attachments;
12 |
13 | import org.eclipse.sw360.antenna.sw360.client.rest.resource.SW360ResourcesTestUtils;
14 |
15 | public class SW360AttachmentTest extends SW360ResourcesTestUtils {
16 | @Override
17 | public SW360Attachment prepareItem() {
18 | SW360Attachment sw360Attachment = new SW360Attachment("test.doc", SW360AttachmentType.SOURCE);
19 | return sw360Attachment;
20 | }
21 |
22 | @Override
23 | public SW360Attachment prepareItemWithoutOptionalInput() {
24 | SW360Attachment sw360Attachment = new SW360Attachment();
25 | sw360Attachment.setFilename("");
26 | return sw360Attachment;
27 | }
28 |
29 | @Override
30 | public Class getHandledClassType() {
31 | return SW360Attachment.class;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core/model/src/main/java/org/eclipse/sw360/antenna/model/artifact/facts/ArtifactIdentifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2018.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | package org.eclipse.sw360.antenna.model.artifact.facts;
13 |
14 | import org.eclipse.sw360.antenna.model.artifact.Artifact;
15 | import org.eclipse.sw360.antenna.model.artifact.ArtifactFact;
16 | import org.eclipse.sw360.antenna.model.artifact.ArtifactSelector;
17 |
18 | public interface ArtifactIdentifier
19 | extends ArtifactFact, ArtifactSelector {
20 | @Override
21 | default boolean matches(Artifact artifact) {
22 | return artifact.getArtifactIdentifiers()
23 | .stream()
24 | .anyMatch(this::matches);
25 | }
26 |
27 | default boolean matches(ArtifactFact artifactFact) {
28 | if(artifactFact instanceof ArtifactIdentifier) {
29 | return matches((ArtifactIdentifier) artifactFact);
30 | }
31 | return false;
32 | }
33 |
34 | boolean matches(ArtifactIdentifier artifactIdentifier);
35 | }
36 |
--------------------------------------------------------------------------------
/modules/sw360/sw360-client/src/main/java/org/eclipse/sw360/antenna/sw360/client/rest/resource/projects/SW360ProjectType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2017-2018.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | package org.eclipse.sw360.antenna.sw360.client.rest.resource.projects;
13 |
14 | public enum SW360ProjectType {
15 | CUSTOMER(0), INTERNAL(1), PRODUCT(2), SERVICE(3), INNER_SOURCE(4);
16 |
17 | private final int value;
18 |
19 | SW360ProjectType(int value) {
20 | this.value = value;
21 | }
22 |
23 | public int getValue() {
24 | return this.value;
25 | }
26 |
27 | public static SW360ProjectType findByValue(int value) {
28 | switch (value) {
29 | case 0:
30 | return CUSTOMER;
31 | case 1:
32 | return INTERNAL;
33 | case 2:
34 | return PRODUCT;
35 | case 3:
36 | return SERVICE;
37 | case 4:
38 | return INNER_SOURCE;
39 | default:
40 | return null;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/modules/attribution-document/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 | 4.0.0
17 |
18 | org.eclipse.sw360.antenna
19 | antenna-management
20 | ${revision}
21 | ../../
22 |
23 |
24 | attribution-document
25 | pom
26 |
27 |
28 |
29 | attribution-document-core
30 | attribution-document-generator
31 | attribution-document-demo-bundle
32 | attribution-document-basic-bundle
33 |
34 |
35 |
--------------------------------------------------------------------------------
/antenna-documentation/src/site/markdown/generators/csv-generator-step.md:
--------------------------------------------------------------------------------
1 | # CSV report generator
2 | ### How to use
3 | Add this configuration to the workflow.xml
4 |
5 | ```xml
6 |
7 |
8 |
9 | CSV Report Generator
10 | org.eclipse.sw360.antenna.workflow.generators.CSVGenerator
11 |
12 |
13 |
14 | ```
15 |
16 | ### How does the output look like:
17 | The output for the example project (`./target/antenna/Antenna_artifactInformation.csv`) looks like:
18 |
19 | ```csv
20 | artifactName;artifactId;groupId;mavenVersion;bundleVersion;license
21 | ;system;com.proprietary.software;1.0.0;;A proprietary License
22 | ;commons-csv;org.apache.commons;1.4;;Apache Software License 2.0
23 | ;log4j-core;org.apache.logging.log4j;2.6.2;;Apache License 2.0
24 | ;commons-math3;org.apache.commons;3.2;;Apache License 2.0
25 | ;jackson-core;com.fasterxml.jackson.core;2.8.4;2.8.4;Apache License 2.0
26 | ;jackson-annotations;com.fasterxml.jackson.core;2.8.4;2.8.4;Apache License 2.0
27 | ArbitraryCopiedCode;;;;;Creative Commons Attribution Share Alike 3.0 Unported
28 | ;system;a.test.project;1.0.0;;htmlArea-1.0
29 | ```
30 |
31 | ### Magic string for output handlers
32 |
33 | When configuring output handlers, the output of the CSV report generator can be referred to by `artifact-information`.
34 |
--------------------------------------------------------------------------------
/modules/sw360/sw360-client/src/main/java/org/eclipse/sw360/antenna/sw360/client/adapter/SW360ProjectAdapterUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2018.
3 | * Copyright (c) Bosch.IO GmbH 2020.
4 | *
5 | * All rights reserved. This program and the accompanying materials
6 | * are made available under the terms of the Eclipse Public License v2.0
7 | * which accompanies this distribution, and is available at
8 | * http://www.eclipse.org/legal/epl-v20.html
9 | *
10 | * SPDX-License-Identifier: EPL-2.0
11 | */
12 | package org.eclipse.sw360.antenna.sw360.client.adapter;
13 |
14 | import org.apache.commons.lang3.StringUtils;
15 | import org.eclipse.sw360.antenna.sw360.client.rest.resource.projects.SW360Project;
16 |
17 | class SW360ProjectAdapterUtils {
18 |
19 | private SW360ProjectAdapterUtils() {}
20 |
21 | public static boolean isValidProject(SW360Project project) {
22 | return StringUtils.isNotEmpty(project.getName()) && StringUtils.isNotEmpty(project.getVersion());
23 | }
24 |
25 | public static boolean hasEqualCoordinates(SW360Project sw360Project, String projectName, String projectVersion) {
26 | boolean isAppIdEqual = sw360Project.getName().equalsIgnoreCase(projectName);
27 | boolean isProjectVersionEqual = sw360Project.getVersion().equalsIgnoreCase(projectVersion);
28 | return isAppIdEqual && isProjectVersionEqual;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/runtime/src/test/java/org/eclipse/sw360/antenna/xml/XMLValidatorTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2013,2016-2017.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.xml;
12 |
13 | import org.eclipse.sw360.antenna.api.exceptions.ConfigurationException;
14 | import org.junit.Test;
15 |
16 | import java.net.MalformedURLException;
17 | import java.net.URL;
18 |
19 | public class XMLValidatorTest {
20 | @Test
21 | public void validateXMLTestValidURL() {
22 | XMLValidator validator = new XMLValidator();
23 | URL xsd = validator.getClass().getResource("/configTest.xsd");
24 | URL xml = validator.getClass().getResource("/antennaconf.xml");
25 | validator.validateXML(xml, xsd);
26 | }
27 |
28 | @Test(expected = ConfigurationException.class)
29 | public void validateXMLTestInvalidURL() throws MalformedURLException {
30 | XMLValidator validator = new XMLValidator();
31 | URL xsd = validator.getClass().getResource("/configTest.xsd");
32 | URL xml = new URL("http://");
33 | validator.validateXML(xml, xsd);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/modules/sw360/sw360-client/src/main/java/org/eclipse/sw360/antenna/sw360/client/rest/resource/Self.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2017-2018.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | package org.eclipse.sw360.antenna.sw360.client.rest.resource;
13 |
14 | import java.io.Serializable;
15 | import java.util.Objects;
16 |
17 | public class Self implements Serializable {
18 | private String href;
19 |
20 | public Self() {
21 | // no-òp
22 | }
23 |
24 | public Self(String href) {
25 | this.href = href;
26 | }
27 |
28 | public String getHref() {
29 | return href;
30 | }
31 |
32 | public Self setHref(String href) {
33 | this.href = href;
34 | return this;
35 | }
36 |
37 | @Override
38 | public boolean equals(Object o) {
39 | if (this == o) return true;
40 | if (o == null || getClass() != o.getClass()) return false;
41 | Self self = (Self) o;
42 | return Objects.equals(href, self.href);
43 | }
44 |
45 | @Override
46 | public int hashCode() {
47 | return Objects.hash(href);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/core/model/src/main/java/org/eclipse/sw360/antenna/model/artifact/facts/ArtifactIssues.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2018.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 |
12 | package org.eclipse.sw360.antenna.model.artifact.facts;
13 |
14 | import org.eclipse.sw360.antenna.model.artifact.ArtifactFactWithPayload;
15 | import org.eclipse.sw360.antenna.model.xml.generated.Issue;
16 | import org.eclipse.sw360.antenna.model.xml.generated.Issues;
17 |
18 | import java.util.Collections;
19 | import java.util.List;
20 |
21 | public class ArtifactIssues extends ArtifactFactWithPayload> {
22 | public ArtifactIssues(Issues issues) {
23 | super(issues.getIssue());
24 | }
25 | public ArtifactIssues(List issues) {
26 | super(issues);
27 | }
28 |
29 | public static List getDefault() {
30 | return Collections.emptyList();
31 | }
32 |
33 | @Override
34 | public String getFactContentName() {
35 | return "Issues";
36 | }
37 |
38 | @Override
39 | public boolean isEmpty() {
40 | return super.isEmpty() || get().size() == 0;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/modules/policy/engine/src/test/java/org/eclipse/sw360/antenna/policy/engine/testdata/TestRule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Bosch Software Innovations GmbH 2019.
3 | *
4 | * All rights reserved. This program and the accompanying materials
5 | * are made available under the terms of the Eclipse Public License v2.0
6 | * which accompanies this distribution, and is available at
7 | * http://www.eclipse.org/legal/epl-v20.html
8 | *
9 | * SPDX-License-Identifier: EPL-2.0
10 | */
11 | package org.eclipse.sw360.antenna.policy.engine.testdata;
12 |
13 | import org.eclipse.sw360.antenna.policy.engine.Rule;
14 | import org.eclipse.sw360.antenna.policy.engine.RuleSeverity;
15 | import org.eclipse.sw360.antenna.policy.engine.Ruleset;
16 |
17 | public class TestRule implements Rule {
18 | private final Ruleset ruleset;
19 |
20 | public TestRule(Ruleset ruleset) {
21 | this.ruleset = ruleset;
22 | }
23 |
24 | @Override
25 | public String getId() {
26 | return "TST";
27 | }
28 |
29 | @Override
30 | public String getName() {
31 | return "Test Rule";
32 | }
33 |
34 | @Override
35 | public String getDescription() {
36 | return "Nothing";
37 | }
38 |
39 | @Override
40 | public RuleSeverity getSeverity() {
41 | return RuleSeverity.WARN;
42 | }
43 |
44 | @Override
45 | public Ruleset getRuleset() {
46 | return ruleset;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------