[jira] [Comment Edited] (MASSEMBLY-864) Dependencies specified in activeByDefault profile not picked up.

2017-07-16 Thread Plamen Totev (JIRA)

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

Plamen Totev edited comment on MASSEMBLY-864 at 7/16/17 3:08 PM:
-

I'm glad the workaround is working.

I've look into the issue a bit more and in general the Maven dependency 
resolution works as expected so for now I don't think there is a need to raise 
a bug with the core. It's interesting why the assembly plugin does not get the 
dependencies from the {{MavenProject}} instance (for example the compiler 
plugin does that and it works) but instead uses somewhat more complex solution. 
So for now it think is better to see if more experienced contributor show some 
love to the issue.


was (Author: plamenttv):
I'm glad the workaround is working.

I've look into the issue a bit more and in general the Maven dependency 
resolution works as expected so for now I don't think there is a need to raise 
a bug with the core. It's interesting why the assembly plugin does not get the 
dependencies from {{MavenProject}} instance (for example the compiler plugin 
does that and it works) but instead uses somewhat more complex solution. So for 
now it think is better to see if more experienced contributor show some love to 
the issue.

> 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:
> 
> jre
> 
> com.oracle:server-jre
> 
> true
> 
> 
> jdk8.74/jre/**/*
> 
> 
> 
> And the following dependency in my pom.xml:
> 
> com.oracle
> server-jre
> linux-x64
> 8.74
> tar.gz
> provided
> 
> 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:
> 
> 
> CommercialDBTest
> 
> true
> 
> 
> 
> com.oracle
> server-jre
> linux-x64
> tar.gz
> provided
> 
> 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)


[jira] [Comment Edited] (MASSEMBLY-864) Dependencies specified in activeByDefault profile not picked up.

2017-07-14 Thread Axel Fontaine (JIRA)

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

Axel Fontaine edited comment on MASSEMBLY-864 at 7/15/17 3:06 AM:
--

Thanks for investigating! What do you think? Should this be raised as a bug 
with Maven Core?

P.S.: Thank you very much for the workaround!! For the first time in months 
Flyway's TravisCI build is now green!


was (Author: axel.fontaine):
Thanks for investigating! What do you think? Should this be raised as a bug 
with Maven Core?

> 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:
> 
> jre
> 
> com.oracle:server-jre
> 
> true
> 
> 
> jdk8.74/jre/**/*
> 
> 
> 
> And the following dependency in my pom.xml:
> 
> com.oracle
> server-jre
> linux-x64
> 8.74
> tar.gz
> provided
> 
> 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:
> 
> 
> CommercialDBTest
> 
> true
> 
> 
> 
> com.oracle
> server-jre
> linux-x64
> tar.gz
> provided
> 
> 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)


[jira] [Comment Edited] (MASSEMBLY-864) Dependencies specified in activeByDefault profile not picked up.

2017-07-14 Thread Axel Fontaine (JIRA)

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

Axel Fontaine edited comment on MASSEMBLY-864 at 7/14/17 10:05 PM:
---

Thanks for investigating! What do you think? Should this be raised as a bug 
with Maven Core?


was (Author: axel.fontaine):
Should this be raised as a bug with Maven Core?

> 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:
> 
> jre
> 
> com.oracle:server-jre
> 
> true
> 
> 
> jdk8.74/jre/**/*
> 
> 
> 
> And the following dependency in my pom.xml:
> 
> com.oracle
> server-jre
> linux-x64
> 8.74
> tar.gz
> provided
> 
> 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:
> 
> 
> CommercialDBTest
> 
> true
> 
> 
> 
> com.oracle
> server-jre
> linux-x64
> tar.gz
> provided
> 
> 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)


[jira] [Comment Edited] (MASSEMBLY-864) Dependencies specified in activeByDefault profile not picked up.

2017-07-14 Thread Plamen Totev (JIRA)

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

Plamen Totev edited comment on MASSEMBLY-864 at 7/14/17 9:47 PM:
-

Thank you for providing the example project. While the issue demonstrated by 
the project is not the same as the one originally reported I wouldn't be 
surprised if they are indeed related.

I took a look at it and I'm afraid I cannot help as my Maven knowledge is not 
enough to fix it (I'm not even sure if it's a bug or feature :D).

I'll write what I found. I hope that it could be of help and safe time for the 
next one that will look at this issue. In order to resolve the dependencies for 
the dependency set phase of the assembly process, assembly plugin uses the 
{{DefaultDependencyResolver}}. To actually resolve the dependencies it uses 
{{LegacyRepositorySystem#resolve}}. When {{LegacyRepositorySystem#resolve}} 
have to resolve the dependencies transitively it starts to resolve the 
dependencies from the root artifact(in your case the - the project itself - 
{{com.axelfontaine:massembly-864}}) and checks all it's dependencies and the 
dependencies of the dependencies (that's why it needs the pom files of the 
dependencies) and so on. So far so good. The problem is that when it resolves 
the dependencies of the root artifact it does not take into account what 
profiles are active - it just picks all dependencies plus the dependencies from 
the active by default profiles. To me it looks like as if it checks the pom 
that is in the repository and not the current project model.

I'm not sure if the behavior of {{LegacyRepositorySystem}} (not part of the 
assembly plugin) is broken or the assembly plugin calls it with wrong 
arguments. Or maybe it should use different class(or dependency resolution 
strategy) altogether. Or maybe this behavior is intentional and desired 
(although I cannot imagine why, maybe there could be a good reason). Would be 
great if somebody could throw some light on the matter.

Meanwhile I think I have workaround for your problem. You could set 
{{useTransitiveDependencies}} to {{false}}. Not sure if it's applicable to your 
actual project but for the example project the following works as expected:
{code:xml}

lib
false

org.flywaydb:flyway-core


{code}

Setting {{useTransitiveDependencies}} to {{false}} means that all {{include}} 
and {{exclude}} filters will be applied only to the direct dependencies and no 
transitive dependencies will be added to the assembly. As I said I'm not sure 
if that is OK for you actual project.


was (Author: plamenttv):
Thank you for providing the example project. While the issue demonstrated by 
the project is not the same as the one originally reported I wouldn't be 
surprised if they are indeed related.

I took a look at it and I'm afraid I cannot help as my Maven knowledge is not 
enough to fix it (I'm not even sure if it's a bug or feature :D).

I'll write what I found. I hope that it could be of help and safe time for the 
next one that will look at this issue. In order to resolve the dependencies for 
the dependency set phase of the assembly process, assembly plugin uses the 
{{DefaultDependencyResolver}}. To actually resolve the dependencies it uses 
{{LegacyRepositorySystem#resolve}}. When {{LegacyRepositorySystem#resolve}} 
have to resolve the dependencies transitively it starts to resolve the 
dependencies from the root artifact(in your case the - the project itself - 
{{com.axelfontaine:massembly-864}}) and checks all it's dependencies and the 
dependencies of the dependencies (that's why it needs the pom files of the 
dependencies) and so on. So far so good. The problem is that when it resolves 
the dependencies of the root artifact it does not take into account what 
profiles are active - it just picks all dependencies plus the dependencies from 
the active by default profiles. To me it looks like as if it checks the pom 
that is in the repository and not the current project model.

I'm not sure if the behavior of {{LegacyRepositorySystem}} (not part of the 
assembly plugin) is broken or the assembly plugin calls it with wrong 
arguments. Or maybe it should use different class(or dependency resolution 
strategy) altogether. Or maybe this behavior is intentional and desired 
(although I cannot imagine why, maybe there could be a good reason). Would be 
great of somebody could throw some light on the matter.

Meanwhile I think I have workaround for your problem. You could set 
{{useTransitiveDependencies}} to {{false}}. Not sure if it's applicable to your 
actual project but for the example project the following works as expected:
{code:xml}

lib
false

org.flywaydb:flyway-core