Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IT for shipped/included dependencies vs not-shipped #596

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/it/shipped-or-not-deps/not-shipped/lib/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cyclonedx.its</groupId>
<artifactId>not-shipped</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>lib</artifactId>

<name>not shipped dependencies: library</name>
<description>Dependencies are purely references, that will be resolved by consumer and eventually version changed.</description>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId><!-- has 3 non-optional transitives: https://commons.apache.org/proper/commons-compress/dependencies.html -->
<version>1.27.1</version><!-- based on consumer context, another version may be really used when lib is used:
this is just version at build time, and default version for consume time if no version conflict resolution or dependencyManagement -->
</dependency>
</dependencies>
</project>
37 changes: 37 additions & 0 deletions src/it/shipped-or-not-deps/not-shipped/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cyclonedx.its</groupId>
<artifactId>shipped-or-not-deps</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>not-shipped</artifactId>
<packaging>pom</packaging>

<modules>
<module>lib</module>
<module>scope</module>
<!--module>optional</module-->
</modules>
</project>
60 changes: 60 additions & 0 deletions src/it/shipped-or-not-deps/not-shipped/scope/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cyclonedx.its</groupId>
<artifactId>not-shipped</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>scope</artifactId>

<name>not shipped dependencies: non-default scoped deps</name>
<description>test, runtime, provided: read https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope</description>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope><!-- only availalbe during tests copilation and run, but not main code compilation -->
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.0</version>
<scope>runtime</scope><!-- not even available at compile time, just during tests execution -->
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>4.0.2</version>
<scope>provided</scope><!-- runtime environment provides it: for example JavaEE/JakartaEE APIs, Maven core internals, Jenkins runner internals, ... -->
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.9</version>
<scope>provided</scope><!-- runtime environment provides it: for example JavaEE/JakartaEE APIs, Maven core internals, Jenkins runner internals, ... -->
</dependency>
</dependencies>
</project>
93 changes: 93 additions & 0 deletions src/it/shipped-or-not-deps/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.cyclonedx.its</groupId>
<artifactId>shipped-or-not-deps</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Issue #589: Example of shipped dependencies vs non-shipped dependencies</name>
<description></description>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin</url>

<inceptionYear>2017</inceptionYear>
<organization>
<name>OWASP Foundation</name>
<url>https://owasp.org/</url>
</organization>

<licenses>
<license>
<name>Apache-2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</connection>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin.git</url>
<developerConnection>scm:git:[email protected]:CycloneDX/cyclonedx-maven-plugin.git</developerConnection>
<tag>HEAD</tag>
</scm>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/issues</url>
</issueManagement>

<ciManagement>
<system>GitHub</system>
<url>https://github.com/CycloneDX/cyclonedx-maven-plugin/actions</url>
</ciManagement>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<modules>
<module>shipped</module>
<module>not-shipped</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>cyclonedx-makeAggregateBom</id>
<phase>package</phase>
<goals>
<goal>makeAggregateBom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
40 changes: 40 additions & 0 deletions src/it/shipped-or-not-deps/shipped/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cyclonedx.its</groupId>
<artifactId>shipped-or-not-deps</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>shipped</artifactId>
<packaging>pom</packaging>

<modules>
<module>war</module>
<!--module>assembly</module>
<module>excludes</module>
<module>shade-full</module>
<module>shade-partial</module>
<module>executable</module-->
</modules>
</project>
57 changes: 57 additions & 0 deletions src/it/shipped-or-not-deps/shipped/war/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of CycloneDX Maven Plugin.

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.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
-->
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.cyclonedx.its</groupId>
<artifactId>shipped</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>war</artifactId>
<packaging>war</packaging><!-- https://maven.apache.org/ref/3.9.9/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging invokes maven-war-plugin -->

<name>shipped dependencies: war</name>
<description>Maven War Plugin copies shipped dependencies to WEB-INF/lib/ as per war spec.</description>

<dependencies>
<dependency>
<groupId>org.cyclonedx.its</groupId>
<artifactId>lib</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.18.0</version><!-- force a version for transitive of lib because Maven conflict resolution = nearest wins -->
</dependency>
</dependencies>

<dependencyManagement><!-- force a version for transitives -->
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.18.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app >
</web-app>