Well it seems that I'm still stuck. As even with different GAV it seems that
the same rules apply :-(
The parent in this case doesn't seem to the the pom-parent, but the artifact
having a dependency on the child artifact.
So I guess Maven wants to figgure out what scope it should set for the children
based upon the scope of the parent.
So if it's a "normal" compile dependency, it leaves the child scope unchanged,
if the parent is "test" or "runtime" then it forces all children to be the
same, which makes sense. But in the end there is that dredded "runtime" if none
of the others apply :-( I wonder why this wasn't a problem prior to 3.1 ... at
least with separate GAV I now have the same problem with Maven 3.0.5 ... at
least I have consistency ;-)
I know that Maven isn't indended on being a pure Java build system, even if it
is mainly used for that. But I have successfully used it for building Java,
Flex, C++ and C# projects. Flex and all the C's support different linking types
while Java effectively supports only one. How would it be to make Maven
extendable with custom scopes? After all we are able to add custom types. If I
were to refactor flexmojos to support different types ("type=swc" = (default)
statically-linked, "type=swc-rsl" = dynamicly linked, "type=swc-include" =
statically-linked with all classes embedded in the output) ... would a this
work?
Assuming I have a pom artifact A containing only one dependency:
<dependency>
<groupId>org.apache.flex.framework</groupId>
<artifactId>B</artifactId>
<version>4.13.0.20140701</version>
<type>swc</type>
</dependency>
And then in my module I have this:
<dependency>
<groupId>org.apache.flex.framework</groupId>
<artifactId>B</artifactId>
<version>4.13.0.20140701</version>
<type>swc-rsl</type>
</dependency>
<dependency>
<groupId>org.apache.flex.framework</groupId>
<artifactId>A</artifactId>
<version>4.13.0.20140701</version>
<type>pom</type>
</dependency>
Then would the type of "B" in the first dependency override the type of "B"
imported by the pom dependency to A? I doubt it ...
I would expect the resulting module to have dependencies to two artifacts "B",
one of type "swc" and one of "swc-rsl".
I would really really like to sort out this problem and release Flexmojos with
support of maven 3.1 and above ... currently we're stuck at 3.0.5 :-(
Chris
-----Ursprüngliche Nachricht-----
Von: Martin Gainty [mailto:[email protected]]
Gesendet: Freitag, 17. Oktober 2014 18:14
An: [email protected]
Betreff: RE: AW: Strange Dependency problem after switching to Maven 3.1.1
> From: [email protected]
> To: [email protected]
> Subject: AW: Strange Dependency problem after switching to Maven 3.1.1
> Date: Fri, 17 Oct 2014 15:04:00 +0000
>
> Ok ... well think I have to answer my own question again :-(
>
> It took me about a day to debug this, but it seems the conflict resolution of
> Maven has changed.
> The thing is the framework:swc has the same name and groupId as the
> framework:rb.swc ... so maven thinks there are two identical dependencies but
> with different scope. This causes maven to go into
> JavaScopeDeriver.getDerivedScope .... here in the end in the "else" simply
> RUNTIME is assumed as a default.
MG>"runtime default scoping" is explained somewhat at
MG>http://books.sonatype.com/mvnref-book/pdf/mvnref-pdf.pdf
MG>clearing up the situation for each dependency to have different GAV
MG>will resolve
I think I will have to refactor the structure of our artifacts to generate the
resource bundles into a different artifact (assumably by appending ".rb" to the
group Id
MG>perhaps the owner of
MG>http://books.sonatype.com/mvnref-book/pdf/mvnref-pdf.pdf doc will allow
documenting this side effect by Chris Dutz...no sense in anyone else being bit
by "Identical GAV default runtime scoping side-effect"
>
> Chris
>
> ________________________________________
> Von: Christofer Dutz <[email protected]>
> Gesendet: Freitag, 17. Oktober 2014 14:28
> An: Maven Users List
> Betreff: AW: Strange Dependency problem after switching to Maven 3.1.1
>
> Actually in MavenProject the "resolvedArtifacts" variable contains this data
> ... not "artifacts" as the runtime artifacts are stripped out by the
> "artifactFilter".
>
> Chris
>
> ________________________________________
> Von: Christofer Dutz <[email protected]>
> Gesendet: Freitag, 17. Oktober 2014 14:20
> An: Maven Users List
> Betreff: Strange Dependency problem after switching to Maven 3.1.1
>
> Hi,
>
>
> I'm currently working on updating the Flexmojos plugin to support newer Maven
> versions. Now I'm having a strange problem:
>
>
> Flexmojos defines Flex dependencies as type "swc" for flex libraries and
> "rb.swc" for resource bundles. Furthermore we have a scope "rsl" (runtime
> shared library) which sort of turns the default static linking to dynamic
> linking.
>
>
> So assume I have an artifact A and B of type "swc" that has one "rb.swc"
> dependency to its corresponding resource bundle.
>
>
> In my project I now add one dependency to A with scope "rsl" and one
> dependency to B with the default "compile" scope.
>
>
> In Maven 3.0.5 I can see the MavenProjects.artifacts list containing
>
>
> A:swc:rsl
>
> A:rb.swc:compile
>
> B:swc:compile
>
> B:rb.swc:compile
>
>
> In Maven 3.1.1 this however is:
>
>
> A:swc:rsl
>
> A:rb.swc:runtime
>
> B:swc:compile
>
> B:rb.swc:compile
>
>
> Why does the scope of the transitive dependencies switch to "runtime" in
> Maven 3.1.1?
>
>
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]