Skip to content

Commit

Permalink
Fix sources goal for multimodule projects
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Manuel Leflet Estrada <jleflete@redhat.com>
  • Loading branch information
jmle authored and slawekjaranowski committed Nov 10, 2023
1 parent da5070f commit 0bb4c59
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 11 deletions.
48 changes: 48 additions & 0 deletions src/it/projects/sources/module-a/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven.its.dependency</groupId>
<artifactId>tree-multimodule</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<name>MultimoduleTest Module A</name>

<artifactId>tree-multimodule-module-a</artifactId>

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

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0.6</version>
</dependency>
</dependencies>

</project>
48 changes: 48 additions & 0 deletions src/it/projects/sources/module-b/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven.its.dependency</groupId>
<artifactId>tree-multimodule</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<name>MultimoduleTest Module B</name>

<artifactId>tree-multimodule-module-b</artifactId>

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

<dependencies>
<dependency>
<groupId>org.apache.maven.its.dependency</groupId>
<artifactId>tree-multimodule-module-a</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

</project>
18 changes: 8 additions & 10 deletions src/it/projects/sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.its.dependency</groupId>
<artifactId>test</artifactId>
<artifactId>tree-multimodule</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Test</name>
<name>MultimoduleTest</name>
<description>
Test dependency:sources
Test dependency:tree on multimodule project
</description>

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

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.0.8</version>
</dependency>
</dependencies>
<modules>
<module>module-a</module>
<module>module-b</module>
</modules>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@Mojo(
name = "sources",
defaultPhase = LifecyclePhase.GENERATE_SOURCES,
requiresDependencyResolution = ResolutionScope.TEST,
requiresDependencyCollection = ResolutionScope.TEST,
threadSafe = true)
public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo {

Expand Down

0 comments on commit 0bb4c59

Please sign in to comment.