Níno Martínez Wael created MASSEMBLY-1001:
---------------------------------------------

             Summary: Excluding pom packaging projects in moduleSet
                 Key: MASSEMBLY-1001
                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-1001
             Project: Maven Assembly Plugin
          Issue Type: Bug
          Components: moduleSet
    Affects Versions: 3.6.0
            Reporter: Níno Martínez Wael


h3. This is a revisit to:

_https://issues.apache.org/jira/browse/MASSEMBLY-676_

_If a project have pom packaging it will be excluded by module-assembly-plugin, 
while iterating over projects in moduleSet. So, there is no way to use 
artifacts, attached to this project._

And revolves around this line:

https://github.com/apache/maven-assembly-plugin/blob/maven-assembly-plugin-3.6.0/src/main/java/org/apache/maven/plugins/assembly/functions/MavenProjects.java#L81
h3. Workaround in old bug report:

_use the artifacts as dependencies._

However I could not use this workaround as it takes the dependency from outside 
the current project reactor set. 
h3. Example

I have a multimodule project where one module builds the assembly and another 
builds the maven site. Maven site artifact are attached as jar with classifier 
site.

Layout simplified

Parent

|-module-application 

|-module-site (pom)

|-module-assembly
h4. content of module-assembly pom
{code:java}
        <dependency>
            <groupId>...</groupId>
            <artifactId>module-site</artifactId>
            <type>jar</type>
            <classifier>site</classifier>
        </dependency>{code}
h4. content of assembly descriptor

 
{code:java}
         <moduleSet>
            <useAllReactorProjects>true</useAllReactorProjects>
            <includes>
                <include>...:module-site</include>
            </includes>
            <binaries>
                <includes>
                    <include>...:module-site:jar:site</include>
                </includes>
                <attachmentClassifier>site</attachmentClassifier>
                <outputDirectory>documentation</outputDirectory>
                <includeDependencies>false</includeDependencies>
                <unpack>true</unpack>
            </binaries>
        </moduleSet>{code}
 

 
h3. The current workaround I use are to get the moduleset included:

By this workaround you will run into

change module-site to the following:

 
{code:java}
    <packaging>jar</packaging>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
related to site plugin when switching to jar package and 
https://issues.apache.org/jira/browse/MJAR-253                         
<id>default-jar</id>
                        <phase>none</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
related to site plugin when using jar packaging                     
<allowIncompleteProjects>true</allowIncompleteProjects>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
related to site plugin when using jar packaging                  
<allowIncompleteProjects>true</allowIncompleteProjects>
                </configuration>
            </plugin> {code}
 

 

 

Possible changes that will make it work:
 * make it possible to allow pom modules by a flag on the moduleset
 * Inspect pom module for requested attached binary and allow if any attached

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to