[ 
https://issues.apache.org/jira/browse/MASSEMBLY-864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079895#comment-16079895
 ] 

Plamen Totev commented on MASSEMBLY-864:
----------------------------------------

Hi,

Could you please check with the latest versions of Maven and the Assembly 
plugin. I've tried with Maven 3.5.0 and Assembly plugin 3.0.0 and I wasn't able 
to reproduce the issue. The only thing that I notice is that you're missing the 
{{scope}} from the {{dependencySet}}. In order to match it should be something 
like this one:
{code:xml}
<dependencySet>
  <outputDirectory>jre</outputDirectory>
  <includes>
    <include>com.oracle:server-jre</include>
  </includes>
  <unpack>true</unpack>
  <unpackOptions>
    <includes>
      <include>jdk8.74/jre/*/</include>
    </includes>
  </unpackOptions>
  <scope>provided</scope>
</dependencySet>
{code}

Please note that the {{scope}} is set to {{provided}}. By default it is 
{{runtime}} and will not match the JRE dependency because it is provided 
dependency. But this behavior is the same for both when the dependency is part 
of a profile and when it is not. Maybe you're hitting another issue I can't 
reproduce. If you could a provide a complete sample project that will reproduce 
the issue it would be very helpful. Also it's worth to mention that I can't 
sound the jre artifact that you use and I've used another instead. While not 
likely it is possible that the problem is because of the artifact. Could you 
reproduce the same issue with another artifact?

> Dependencies specified in activeByDefault profile not picked up.
> ----------------------------------------------------------------
>
>                 Key: MASSEMBLY-864
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-864
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Axel Fontaine
>
> I have the following dependencySet in my assembly XML:
> <dependencySet>
>     <outputDirectory>jre</outputDirectory>
>     <includes>
>         <include>com.oracle:server-jre</include>
>     </includes>
>     <unpack>true</unpack>
>     <unpackOptions>
>         <includes>
>             <include>jdk8.74/jre/**/*</include>
>         </includes>
>     </unpackOptions>
> </dependencySet>
> And the following dependency in my pom.xml:
> <dependency>
>     <groupId>com.oracle</groupId>
>     <artifactId>server-jre</artifactId>
>     <classifier>linux-x64</classifier>
>     <version>8.74</version>
>     <type>tar.gz</type>
>     <scope>provided</scope>
> </dependency>
> The dependency gets correctly picked up when it is declared within the main 
> dependencies section of the POM. However when it is only present within a 
> profile:
>     <profiles>
>         <profile>
>             <id>CommercialDBTest</id>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>             <dependencies>
>                 <dependency>
>                     <groupId>com.oracle</groupId>
>                     <artifactId>server-jre</artifactId>
>                     <classifier>linux-x64</classifier>
>                     <type>tar.gz</type>
>                     <scope>provided</scope>
>                 </dependency>
> I then get
> [WARNING] The following patterns were never triggered in this artifact 
> exclusion filter:
> o  'com.oracle:server-jre'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to