Skip to content

Commit

Permalink
Add optional dependency for install ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Mar 20, 2023
1 parent de1dbbf commit f46013f
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/it/staging-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ under the License.
<version>1.7.36</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
<optional>true</optional>
</dependency>
</dependencies>

<repositories>
Expand Down
5 changes: 4 additions & 1 deletion src/it/staging-dependencies/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ try
"org/apache/maven/its/dep/2.0/dep-2.0.jar",
"org/apache/maven/its/dep/maven-metadata-local.xml",
"test/staging-dependencies/1.0-SNAPSHOT/staging-dependencies-1.0-SNAPSHOT.jar",
"test/staging-dependencies/1.0-SNAPSHOT/staging-dependencies-1.0-SNAPSHOT.pom"
"test/staging-dependencies/1.0-SNAPSHOT/staging-dependencies-1.0-SNAPSHOT.pom",
"org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom",
"org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar",
"org/slf4j/slf4j-parent/1.7.36/slf4j-parent-1.7.36.pom"
};
for ( String file : files )
{
Expand Down
8 changes: 7 additions & 1 deletion src/it/staging-reactor/mod1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ under the License.
<relativePath>../mod1-parent</relativePath>
</parent>

<artifactId>mod1</artifactId>
<artifactId>mod1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

Expand All @@ -47,6 +47,12 @@ under the License.
<artifactId>mod2</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>test</groupId>
<artifactId>mod3</artifactId>
<version>1.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
</dependencies>

<build>
Expand Down
59 changes: 59 additions & 0 deletions src/it/staging-reactor/mod3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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.
-->

<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>test</groupId>
<artifactId>mod2-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>mod3</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<description>
Test to check for proper staging during a multi module build, i.e. artifacts from the reactor need to be considered.
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>@sourcePluginVersion@</version>
<executions>
<execution>
<id>attach-resources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
17 changes: 17 additions & 0 deletions src/it/staging-reactor/mod3/src/main/resources/main.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.

1 change: 1 addition & 0 deletions src/it/staging-reactor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ under the License.
<modules>
<module>mod1</module>
<module>mod2</module>
<module>mod3</module>
</modules>

<properties>
Expand Down
3 changes: 3 additions & 0 deletions src/it/staging-reactor/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ try
"test/mod2/1.0-SNAPSHOT/maven-metadata-local.xml",
"test/mod2/1.0-SNAPSHOT/mod2-1.0-SNAPSHOT.pom",
"test/mod2/1.0-SNAPSHOT/mod2-1.0-SNAPSHOT.jar",
"test/mod3/1.0-SNAPSHOT/maven-metadata-local.xml",
"test/mod3/1.0-SNAPSHOT/mod3-1.0-SNAPSHOT.pom",
"test/mod3/1.0-SNAPSHOT/mod3-1.0-SNAPSHOT.jar",
"test/mod2-parent/maven-metadata-local.xml",
"test/mod2-parent/1.0-SNAPSHOT/maven-metadata-local.xml",
"test/mod2-parent/1.0-SNAPSHOT/mod2-parent-1.0-SNAPSHOT.pom",
Expand Down

0 comments on commit f46013f

Please sign in to comment.