Re: I've staring at an apparent m3 regression from m2, how about a bit of coaching as to how to track it down?

2011-12-09 Thread Benson Margulies
I have no problem with just putting process-classes on the command
line, now that I'm awake.

On Thu, Dec 8, 2011 at 7:34 PM, Martin Gainty mgai...@hotmail.com wrote:

 Benson-

 if process-classes is missing how about placing 'process-classes' in a 
 customised lifecycle
 src/main/resources/META-INF/plexus/components.xmlhttp://www.sonatype.com/people/2009/08/create-a-customized-build-process-in-maven/

 Martin
 __
 ..all the smart people get off at Kendall Square..


 Date: Wed, 7 Dec 2011 21:27:01 -0500
 Subject: I've staring at an apparent m3 regression from m2, how about a bit 
 of coaching as to how to track it down?he
 From: bimargul...@gmail.com
 To: dev@maven.apache.org

 MSITE-623 describes the situation, but, in fact, it's not MSITE at all.

 In the case at hand, the artifact resolver is returning the current
 target/classes pathname that goes with the 'jar' artifact as the
 answer to a question about the 'wsdl' artifact. Maven 2.2.1 does fine.

 Where do I start?

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: 'Get thee to the core' a concrete opportunity

2011-12-09 Thread Benson Margulies
Brett,

What are you debugging in these days?



On Thu, Dec 8, 2011 at 12:31 PM, Brett Porter br...@apache.org wrote:
 Are you running Maven from the IDE, or using the mvnDebug remote debugging?

 If you have the Maven projects open, and then attach to a Maven process built 
 from those sources, you should be able to trace into them instead - or at 
 least set a breakpoint in there.

 Been ages since I used Eclipse though, so not sure if that's still valid 
 there.

 On 08/12/2011, at 10:34 PM, Benson Margulies wrote:

 I want to see if I can chase MNG-5214 to its lair. I need a little bit
 of coaching to get the debugging process going.

 In the test case, there's a maven plugin which declares various maven
 2 components as provided dependencies, notably the
 DefaultArtifactResolver. So, my IDE keeps trying (I think) to show me
 the source to the 2.2.1 version even though, since I'm running M3, I'm
 using the M3 version. I'm suspecting that you core spelunkers can tell
 me how to get Eclipse unconfused. If there's a doc, please point me at
 it. If there isn't, please clue me in, and I'll write it.


 On Wed, Dec 7, 2011 at 9:27 PM, Benson Margulies bimargul...@gmail.com 
 wrote:
 MSITE-623 describes the situation, but, in fact, it's not MSITE at all.

 In the case at hand, the artifact resolver is returning the current
 target/classes pathname that goes with the 'jar' artifact as the
 answer to a question about the 'wsdl' artifact. Maven 2.2.1 does fine.

 Where do I start?

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org


 --
 Brett Porter
 br...@apache.org
 http://brettporter.wordpress.com/
 http://au.linkedin.com/in/brettporter





 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: 'Get thee to the core' a concrete opportunity

2011-12-09 Thread Benson Margulies
Olivier,

You're pointing at the original problem: that process-classses doesn't
get included in the forked lifecycle.

I'm trying to start with the second problem: that the resolver gives a
bogus answer.

--benson


On Thu, Dec 8, 2011 at 11:05 AM, Olivier Lamy ol...@apache.org wrote:
 2011/12/8 Benson Margulies bimargul...@gmail.com:
 I want to see if I can chase MNG-5214 to its lair. I need a little bit
 of coaching to get the debugging process going.

 In the test case, there's a maven plugin which declares various maven
 2 components as provided dependencies, notably the
 DefaultArtifactResolver. So, my IDE keeps trying (I think) to show me
 the source to the 2.2.1 version even though, since I'm running M3, I'm
 using the M3 version. I'm suspecting that you core spelunkers can tell
 me how to get Eclipse unconfused. If there's a doc, please point me at
 it. If there isn't, please clue me in, and I'll write it.

 Perso I have same issue even with idea :-)
 Yup maven ide integration doesn't override core dependencies with
 your running core.

 BTW looks to be an issue with @aggregator and forked lifecycle in
 javadoc aggregator mojo.

 I recommend you have a look how this forkedLifecycle is calculated.
 Various places to investigate are :
 * maven-reporting-exec component in shared path
 * in core: DefaultLifecycleExecutor especially methods:
 calculateForkedExecutions and executeForkedExecutions (that's the
 point where javadoc aggregator is executed in case of the site plugin
 in 3.x )

 HTH



 On Wed, Dec 7, 2011 at 9:27 PM, Benson Margulies bimargul...@gmail.com 
 wrote:
 MSITE-623 describes the situation, but, in fact, it's not MSITE at all.

 In the case at hand, the artifact resolver is returning the current
 target/classes pathname that goes with the 'jar' artifact as the
 answer to a question about the 'wsdl' artifact. Maven 2.2.1 does fine.

 Where do I start?

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org




 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: 'Get thee to the core' a concrete opportunity

2011-12-09 Thread Jesse Glick

On 12/08/2011 06:34 AM, Benson Margulies wrote:

In the test case, there's a maven plugin which declares various maven
2 components as provided dependencies, notably the
DefaultArtifactResolver. So, my IDE keeps trying (I think) to show me
the source to the 2.2.1 version even though, since I'm running M3, I'm
using the M3 version.


FWIW - using a NetBeans 7.2 dev build (close to 7.1 RC2), I:

1. Opened the M3 root POM (File  Open Project) so the IDE knows where all the 
submodule projects are.

2. Opened the Maven Embedder module. Accept suggestion to prime.

3. Under File  Project Properties  Run, set Main Class to org.apache.maven.cli.MavenCli, and Arguments to -f .../pom.xml clean install for a project using 
nbm-maven-plugin 3.6 (more or less arbitrarily).


4. Opened sources for nbm-maven-plugin. Accept suggestion to prime. Go to Type on DefaultArtifactResolver offers both the 3.0.x source project version, and the 2.0.6 
repository version (since both are in classpath of an open project). Accept the first.


5. Set a breakpoint in the constructor (int threads = ...).

6. Debug Project on Maven Embedder.

7. Breakpoint hit in the correct DefaultArtifactResolver.java. Debug  Step Over shows threads=5 in the Variables view as expected (the 2.0.6 version has no such 
constructor code).


Alternately, if bundled Maven binary (currently 3.0.3) suffices:

3. [can be skipped but then Step Over will not work] Window  Debugging  Sources with test project selected, Add Source Root, select .../maven-compat/src/main/java/ 
(will be default filechooser location if DAR.java selected in editor).


6. Right-click test project, Custom  Goals..., clean install under Goals, 
jpda.listen=maven (i.e. launch Maven itself inside debugger) under Properties.


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



org.apache.maven.artifact.ArtifactUtils

2011-12-09 Thread Benson Margulies
This makes keys that leave out type and classifier.

And then things invalid matches happen in MNG-5214.

The obvious fix is to use type and classifier, defaulting type to jar.
What will I break if I do that?

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: org.apache.maven.artifact.ArtifactUtils

2011-12-09 Thread Benson Margulies
Ignore the below. I've found the spot in the reader that actually
forgets to check the classifier and the type.

On Fri, Dec 9, 2011 at 12:59 PM, Benson Margulies bimargul...@gmail.com wrote:
 This makes keys that leave out type and classifier.

 And then things invalid matches happen in MNG-5214.

 The obvious fix is to use type and classifier, defaulting type to jar.
 What will I break if I do that?

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Stephen Connolly
refinement: test-jar should resolve to test-classes as a fallback

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +formatdir/format
 formatzip/format
 formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
 {
 return projectArtifact.getFile();
 }
 -else if ( !hasBeenPackaged( project ) )
 +else if ( !hasBeenPackaged( project ) )
 {
 // fallback to loose class files only if artifacts haven't
 been packaged yet
 +// and only for plain old jars. Not war files, not ear files,
 not anything else.

 if ( isTestArtifact( artifact ) )
 {
 @@ -98,7 +99,7 @@ class ReactorReader
 }
 else
 {
 -if ( project.hasLifecyclePhase( compile ) )
 +if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
 {
 return new File(
 project.getBuild().getOutputDirectory() );
 }
 @@ -143,7 +144,9 @@ class ReactorReader
 {
 for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )
 {
 -if ( requestedRepositoryConflictId.equals( getConflictId(
 attachedArtifact ) ) )
 +if ( requestedArtifact.getProperty ( type,  ).equals(
 attachedArtifact.getType() )
 +  classifierComparison (
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +  requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
 {
 return attachedArtifact;
 }
 @@ -152,6 +155,12 @@ class ReactorReader

 return null;
 }
 +
 +private boolean classifierComparison ( String c1, String c2 )
 +{
 +return c1 == null  c2 == null
 +|| ((c1 != null)  c1.equals(c2));
 +}

 /**
  * Gets the repository conflict id of the specified artifact. Unlike
 the dependency conflict id, the repository





Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
On Fri, Dec 9, 2011 at 2:19 PM, Stephen Connolly
stephen.alan.conno...@gmail.com wrote:
 refinement: test-jar should resolve to test-classes as a fallback

It does. I didn't disturb that particular fallback. I can point you at
it if you like.



 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format
     formatzip/format
     formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't
 been packaged yet
 +            // and only for plain old jars. Not war files, not ear files,
 not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
                 {
                     return new File(
 project.getBuild().getOutputDirectory() );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )
             {
 -                if ( requestedRepositoryConflictId.equals( getConflictId(
 attachedArtifact ) ) )
 +                if ( requestedArtifact.getProperty ( type,  ).equals(
 attachedArtifact.getType() )
 +                      classifierComparison (
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +                      requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
                 {
                     return attachedArtifact;
                 }
 @@ -152,6 +155,12 @@ class ReactorReader

         return null;
     }
 +
 +    private boolean classifierComparison ( String c1, String c2 )
 +    {
 +        return c1 == null  c2 == null
 +                        || ((c1 != null)  c1.equals(c2));
 +    }

     /**
      * Gets the repository conflict id of the specified artifact. Unlike
 the dependency conflict id, the repository




-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Stephen Connolly
it is left as an exercise to the reader to navigate the full fun of test
jars (classifier test type jar or no classifier and type test-jar or some
other wantonness (phone for once suggested suitable autocorrect fir
randomness))

source jars could also be resolved too... but i would suggest not.

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 9 Dec 2011 19:19, Stephen Connolly stephen.alan.conno...@gmail.com
wrote:

 refinement: test-jar should resolve to test-classes as a fallback

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +formatdir/format
 formatzip/format
 formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
 {
 return projectArtifact.getFile();
 }
 -else if ( !hasBeenPackaged( project ) )
 +else if ( !hasBeenPackaged( project ) )
 {
 // fallback to loose class files only if artifacts haven't
 been packaged yet
 +// and only for plain old jars. Not war files, not ear
 files, not anything else.

 if ( isTestArtifact( artifact ) )
 {
 @@ -98,7 +99,7 @@ class ReactorReader
 }
 else
 {
 -if ( project.hasLifecyclePhase( compile ) )
 +if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
 {
 return new File(
 project.getBuild().getOutputDirectory() );
 }
 @@ -143,7 +144,9 @@ class ReactorReader
 {
 for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )
 {
 -if ( requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
 +if ( requestedArtifact.getProperty ( type, 
 ).equals( attachedArtifact.getType() )
 +  classifierComparison (
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +  requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
 {
 return attachedArtifact;
 }
 @@ -152,6 +155,12 @@ class ReactorReader

 return null;
 }
 +
 +private boolean classifierComparison ( String c1, String c2 )
 +{
 +return c1 == null  c2 == null
 +|| ((c1 != null)  c1.equals(c2));
 +}

 /**
  * Gets the repository conflict id of the specified artifact. Unlike
 the dependency conflict id, the repository





Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Olivier Lamy
Hello,

2011/12/9  bimargul...@apache.org:
 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for 
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember to 
 match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of type 
 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone hates 
 this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
    
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL: 
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff
 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9 
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format

Why ?

I wonder if you could add a core it test for this use case ?
The use case is the cxf build you pointed ?

     formatzip/format
     formattar.gz/format
   /formats

 Modified: 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL: 
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff
 ==
 --- 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
  (original)
 +++ 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
  Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't been 
 packaged yet
 +            // and only for plain old jars. Not war files, not ear files, 
 not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile )  
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non- 
 classifier? */
                 {
                     return new File( project.getBuild().getOutputDirectory() 
 );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact : 
 attachedArtifacts )
             {
 -                if ( requestedRepositoryConflictId.equals( getConflictId( 
 attachedArtifact ) ) )
 +                if ( requestedArtifact.getProperty ( type,  ).equals( 
 attachedArtifact.getType() )
 +                      classifierComparison ( 
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +                      requestedRepositoryConflictId.equals( getConflictId( 
 attachedArtifact ) ) )
                 {
                     return attachedArtifact;
                 }
 @@ -152,6 +155,12 @@ class ReactorReader

         return null;
     }
 +
 +    private boolean classifierComparison ( String c1, String c2 )
 +    {
 +        return c1 == null  c2 == null
 +                        || ((c1 != null)  c1.equals(c2));
 +    }

     /**
      * Gets the repository conflict id of the specified artifact. Unlike the 
 dependency conflict id, the repository





-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
Yes, I can. Can you tell me where some similar tests live?

On Fri, Dec 9, 2011 at 2:43 PM, Olivier Lamy ol...@apache.org wrote:
 Hello,

 2011/12/9  bimargul...@apache.org:
 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for 
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember to 
 match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of type 
 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone hates 
 this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
    
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL: 
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff
 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9 
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format

 Why ?

 I wonder if you could add a core it test for this use case ?
 The use case is the cxf build you pointed ?

     formatzip/format
     formattar.gz/format
   /formats

 Modified: 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL: 
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff
 ==
 --- 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
  (original)
 +++ 
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
  Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't been 
 packaged yet
 +            // and only for plain old jars. Not war files, not ear files, 
 not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile )  
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non- 
 classifier? */
                 {
                     return new File( project.getBuild().getOutputDirectory() 
 );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact : 
 attachedArtifacts )
             {
 -                if ( requestedRepositoryConflictId.equals( getConflictId( 
 attachedArtifact ) ) )
 +                if ( requestedArtifact.getProperty ( type,  ).equals( 
 attachedArtifact.getType() )
 +                      classifierComparison ( 
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +                      requestedRepositoryConflictId.equals( 
 getConflictId( attachedArtifact ) ) )
                 {
                     return attachedArtifact;
                 }
 @@ -152,6 +155,12 @@ class ReactorReader

         return null;
     }
 +
 +    private boolean classifierComparison ( String c1, String c2 )
 +    {
 +        return c1 == null  c2 == null
 +                        || ((c1 != null)  c1.equals(c2));
 +    }

     /**
      * Gets the repository conflict id of the specified artifact. Unlike the 
 dependency conflict id, the repository





 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
As for the format; I explained in the svn comment. I found it
convenient to be able to just run the newly-built package without
unpacking it. If it really bugs anyone I can undo it.

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Olivier Lamy
Did you try to use the ant bootstrap build ? (which will be faster IMHO )

2011/12/9 Benson Margulies bimargul...@gmail.com:
 As for the format; I explained in the svn comment. I found it
 convenient to be able to just run the newly-built package without
 unpacking it. If it really bugs anyone I can undo it.

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org




-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
On Fri, Dec 9, 2011 at 2:22 PM, Stephen Connolly
stephen.alan.conno...@gmail.com wrote:
 it is left as an exercise to the reader to navigate the full fun of test
 jars (classifier test type jar or no classifier and type test-jar or some
 other wantonness (phone for once suggested suitable autocorrect fir
 randomness))

 source jars could also be resolved too... but i would suggest not.

Some more explication:

Step 1: org.apache.maven.ReactorReader.findMatchingArtifact(MavenProject,
Artifact) is trying to find a matching artifact, but did not take type
or classifier into account at all. There is no reason for special
handling of test-jar/tests here.

Step 2: org.apache.maven.ReactorReader.find(MavenProject, Artifact) is
implementing the fallback to 'classes' directories. For tests, it
already checks both type and classifier to tell what's a test jar.
However, when the artifact is not a test jar, the code went ahead and
returned 'classes' for *anything*, regardless of type or classifier,
if 'compile' was in the lifecycle.





 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 19:19, Stephen Connolly stephen.alan.conno...@gmail.com
 wrote:

 refinement: test-jar should resolve to test-classes as a fallback

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format
     formatzip/format
     formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't
 been packaged yet
 +            // and only for plain old jars. Not war files, not ear
 files, not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
                 {
                     return new File(
 project.getBuild().getOutputDirectory() );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )
             {
 -                if ( requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
 +                if ( requestedArtifact.getProperty ( type, 
 ).equals( attachedArtifact.getType() )
 +                      classifierComparison (
 requestedArtifact.getClassifier(), attachedArtifact.getClassifier() )
 +                      

Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
On Fri, Dec 9, 2011 at 5:27 PM, Olivier Lamy ol...@apache.org wrote:
 Did you try to use the ant bootstrap build ? (which will be faster IMHO )

No, I did not.


 2011/12/9 Benson Margulies bimargul...@gmail.com:
 As for the format; I explained in the svn comment. I found it
 convenient to be able to just run the newly-built package without
 unpacking it. If it really bugs anyone I can undo it.

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org




 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: 'Get thee to the core' a concrete opportunity

2011-12-09 Thread Benson Margulies
On the substance of the original problem:

user runs 'mvn site:site'

site:site finds javadoc and checkstyle, trigger a forked lifecycle to
generate sources.

In this particular case, 'generate-sources' in module 'b' depends on
running out through 'process-classes' in module 'a'.  b has a
compile-scope dependency on agroup:aartifact:aversion:wsdl.

Is the lifecycle calculator supposed to figure this out? It has no way
to tell which execution in 'a' produces
agroup:aartifact:aversion:wsdl, so it has no way to tell that
'process-classes' is going to be required.

However, adding 'process-classes' to the top-level command line
doesn't help, apparently because it doesn't travel from the initial
execution plan to the forked execution plan.

Once you have the fix I made today, you can get around this by running
'mvn install' to stuff the wsdl artifact into the local repo before
running site:site.

But if the intent is to avoid this requirement, how is it supposed to work?

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Yes I have some IT failures to deal with

2011-12-09 Thread Benson Margulies
I'm working on it. Next time i'll run them locally before I commit.

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Stephen Connolly
My point is that if returning classes is correct for a jar with no
classifier, then the correct thing to do for a test-jar is return
test-classes

On 9 December 2011 22:29, Benson Margulies bimargul...@gmail.com wrote:
 On Fri, Dec 9, 2011 at 2:22 PM, Stephen Connolly
 stephen.alan.conno...@gmail.com wrote:
 it is left as an exercise to the reader to navigate the full fun of test
 jars (classifier test type jar or no classifier and type test-jar or some
 other wantonness (phone for once suggested suitable autocorrect fir
 randomness))

 source jars could also be resolved too... but i would suggest not.

 Some more explication:

 Step 1: org.apache.maven.ReactorReader.findMatchingArtifact(MavenProject,
 Artifact) is trying to find a matching artifact, but did not take type
 or classifier into account at all. There is no reason for special
 handling of test-jar/tests here.

 Step 2: org.apache.maven.ReactorReader.find(MavenProject, Artifact) is
 implementing the fallback to 'classes' directories. For tests, it
 already checks both type and classifier to tell what's a test jar.
 However, when the artifact is not a test jar, the code went ahead and
 returned 'classes' for *anything*, regardless of type or classifier,
 if 'compile' was in the lifecycle.





 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 19:19, Stephen Connolly stephen.alan.conno...@gmail.com
 wrote:

 refinement: test-jar should resolve to test-classes as a fallback

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format
     formatzip/format
     formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't
 been packaged yet
 +            // and only for plain old jars. Not war files, not ear
 files, not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
                 {
                     return new File(
 project.getBuild().getOutputDirectory() );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )
             {
 -                if ( requestedRepositoryConflictId.equals(
 getConflictId( attachedArtifact ) ) )
 +                if ( 

Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Stephen Connolly
To further clarify, the correct thing to do for a test-jar when
there is no test-jar, is to fall back to test-classes

On 9 December 2011 23:12, Stephen Connolly
stephen.alan.conno...@gmail.com wrote:
 My point is that if returning classes is correct for a jar with no
 classifier, then the correct thing to do for a test-jar is return
 test-classes

 On 9 December 2011 22:29, Benson Margulies bimargul...@gmail.com wrote:
 On Fri, Dec 9, 2011 at 2:22 PM, Stephen Connolly
 stephen.alan.conno...@gmail.com wrote:
 it is left as an exercise to the reader to navigate the full fun of test
 jars (classifier test type jar or no classifier and type test-jar or some
 other wantonness (phone for once suggested suitable autocorrect fir
 randomness))

 source jars could also be resolved too... but i would suggest not.

 Some more explication:

 Step 1: org.apache.maven.ReactorReader.findMatchingArtifact(MavenProject,
 Artifact) is trying to find a matching artifact, but did not take type
 or classifier into account at all. There is no reason for special
 handling of test-jar/tests here.

 Step 2: org.apache.maven.ReactorReader.find(MavenProject, Artifact) is
 implementing the fallback to 'classes' directories. For tests, it
 already checks both type and classifier to tell what's a test jar.
 However, when the artifact is not a test jar, the code went ahead and
 returned 'classes' for *anything*, regardless of type or classifier,
 if 'compile' was in the lifecycle.





 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 19:19, Stephen Connolly stephen.alan.conno...@gmail.com
 wrote:

 refinement: test-jar should resolve to test-classes as a fallback

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format
     formatzip/format
     formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't
 been packaged yet
 +            // and only for plain old jars. Not war files, not ear
 files, not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
                 {
                     return new File(
 project.getBuild().getOutputDirectory() );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( 

Re: svn commit: r1212564 - in /maven/maven-3/trunk: apache-maven/src/main/assembly/bin.xml maven-core/src/main/java/org/apache/maven/ReactorReader.java

2011-12-09 Thread Benson Margulies
On Fri, Dec 9, 2011 at 6:12 PM, Stephen Connolly
stephen.alan.conno...@gmail.com wrote:
 My point is that if returning classes is correct for a jar with no
 classifier, then the correct thing to do for a test-jar is return
 test-classes

Right. I didn't break that code which was already there.


 On 9 December 2011 22:29, Benson Margulies bimargul...@gmail.com wrote:
 On Fri, Dec 9, 2011 at 2:22 PM, Stephen Connolly
 stephen.alan.conno...@gmail.com wrote:
 it is left as an exercise to the reader to navigate the full fun of test
 jars (classifier test type jar or no classifier and type test-jar or some
 other wantonness (phone for once suggested suitable autocorrect fir
 randomness))

 source jars could also be resolved too... but i would suggest not.

 Some more explication:

 Step 1: org.apache.maven.ReactorReader.findMatchingArtifact(MavenProject,
 Artifact) is trying to find a matching artifact, but did not take type
 or classifier into account at all. There is no reason for special
 handling of test-jar/tests here.

 Step 2: org.apache.maven.ReactorReader.find(MavenProject, Artifact) is
 implementing the fallback to 'classes' directories. For tests, it
 already checks both type and classifier to tell what's a test jar.
 However, when the artifact is not a test jar, the code went ahead and
 returned 'classes' for *anything*, regardless of type or classifier,
 if 'compile' was in the lifecycle.





 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 19:19, Stephen Connolly stephen.alan.conno...@gmail.com
 wrote:

 refinement: test-jar should resolve to test-classes as a fallback

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 9 Dec 2011 18:30, bimargul...@apache.org wrote:

 Author: bimargulies
 Date: Fri Dec  9 18:30:26 2011
 New Revision: 1212564

 URL: http://svn.apache.org/viewvc?rev=1212564view=rev
 Log:
 MNG-5214: Dependency resolution substitutes g:a:v:jar for
 j:a:v:something-else when something-else isn't in the reacto

 o When Aether asks the ReactorReader for a file for an artifact, remember
 to match type and classifier. And if all else
  fails, do not return target/classes if the desired artifact is not of
 type 'jar'. Arguably, if type or classifier
  are non-default, then we should never return those default paths at all.
 o Add 'dir' format to make it quicker to run a quick test. If everyone
 hates this I'll revert it.

 Modified:
    maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml

  maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java

 Modified: maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml?rev=1212564r1=1212563r2=1212564view=diff

 ==
 --- maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml (original)
 +++ maven/maven-3/trunk/apache-maven/src/main/assembly/bin.xml Fri Dec  9
 18:30:26 2011
 @@ -20,6 +20,7 @@ under the License.
  assembly
   idbin/id
   formats
 +    formatdir/format
     formatzip/format
     formattar.gz/format
   /formats

 Modified:
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 URL:
 http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java?rev=1212564r1=1212563r2=1212564view=diff

 ==
 ---
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 (original)
 +++
 maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/ReactorReader.java
 Fri Dec  9 18:30:26 2011
 @@ -85,9 +85,10 @@ class ReactorReader
         {
             return projectArtifact.getFile();
         }
 -        else if ( !hasBeenPackaged( project ) )
 +        else if ( !hasBeenPackaged( project ) )
         {
             // fallback to loose class files only if artifacts haven't
 been packaged yet
 +            // and only for plain old jars. Not war files, not ear
 files, not anything else.

             if ( isTestArtifact( artifact ) )
             {
 @@ -98,7 +99,7 @@ class ReactorReader
             }
             else
             {
 -                if ( project.hasLifecyclePhase( compile ) )
 +                if ( project.hasLifecyclePhase( compile ) 
 artifact.getProperty( type, ).equals( jar ) ) /* also reject non-
 classifier? */
                 {
                     return new File(
 project.getBuild().getOutputDirectory() );
                 }
 @@ -143,7 +144,9 @@ class ReactorReader
         {
             for ( org.apache.maven.artifact.Artifact attachedArtifact :
 attachedArtifacts )