Hi Robert and devs,

I fixed artifact resolution issues we spoke about last time, see the branch
3.0-rc1, you may now have a look in surefire project.

but there is the last issue. I should exclude org
.apache.maven.shared.artifact.resolve.ArtifactResolverException
from reallocation in maven-shade-plugin. This class is in
maven-artifact-transfer:3.0-SNAPSHOT.

I will continue on it some other day.

I am not sure if the plugins would work properly with my changes, let's see
next time.
If you have time, please make a code review.

Caused by: java.lang.ClassNotFoundException:
org.apache.maven.surefire.shade.org.apache.maven.shared.artifact.resolve.ArtifactResolverException

Cheers
Tibor

On Sat, Jan 9, 2016 at 1:17 PM, Robert Scholte <[email protected]> wrote:

> Hi Tibor,
>
> Regarding the artifactResolver.resolveTransitively, this has been replaced
> with dependencyResolver. The reason is that an artifact is basically a
> coordinate with a file, it is not aware of dependencies.
>
> I've traced one down for you:
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.getForkConfiguration()
> contains
> Artifact shadeFire = getPluginArtifactMap().get(
> "org.apache.maven.surefire:surefire-shadefire" );
>
> If you get the Plugin instead and use
> org.apache.maven.shared.dependency.TransferUtils.toDependencyCoordinate(
> plugin )
> , then you'll be able to get all dependencies and their artifacts for the
> classpath.
>
> I'll leave the fixing up to you to get some more feedback on the
> maven-artifact-transfer components.
>
> thanks,
> Robert
>
> Op Thu, 07 Jan 2016 20:33:47 +0100 schreef Tibor Digana <
> [email protected]>:
>
>
> Now I removed maven-compat completely.
>>
>> <dependency>
>>   <groupId>org.apache.maven.shared</groupId>
>>   <artifactId>maven-artifact-transfer</artifactId>
>>   <version>3.0-SNAPSHOT</version>
>> </dependency>
>>
>> It seems release version is not available.
>>
>> I should resolve compilation error after new 3.0 AtrifactResolver and
>> I will come back to you.
>>
>>
>>
>>
>> return artifactResolver.resolveTransitively( Collections.singleton(
>> providerArtifact ), originatingArtifact,
>>                                              localRepository,
>> remoteRepositories, artifactMetadataSource,
>>                                              filter );
>>
>>
>>
>>
>> On Thu, Jan 7, 2016 at 7:39 PM, Robert Scholte <[email protected]>
>> wrote:
>>
>> Hi Tibor,
>>>
>>> Bullet 4: Remove maven-compat (or give it the test-scope if it is
>>> required
>>> by the maven-plugin-testing-harness)
>>>
>>> Now I think you're at a state where Maven2 classes must be replaced with
>>> Maven3 solutions.
>>>
>>> Robert
>>>
>>> Op Thu, 07 Jan 2016 18:54:06 +0100 schreef Tibor Digana <
>>> [email protected]>:
>>>
>>>
>>> Hi Robert,
>>>
>>>>
>>>> I did as you said and I have new issue. Any dea?
>>>>
>>>>
>>>>
>>>>
>>>> testSurefireReportSingleError(org.apache.maven.plugins.surefire.report.SurefireReportMojoTest)
>>>> Time elapsed: 0.042 sec  <<< ERROR!
>>>>
>>>>
>>>> org.codehaus.plexus.component.repository.exception.ComponentLookupException:
>>>> java.util.NoSuchElementException
>>>>       role: org.apache.maven.repository.RepositorySystem
>>>>   roleHint:
>>>>     at
>>>>
>>>>
>>>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
>>>>     at
>>>>
>>>>
>>>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:241)
>>>>     at
>>>>
>>>>
>>>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
>>>>     at
>>>> org.codehaus.plexus.PlexusTestCase.lookup(PlexusTestCase.java:207)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.plugin.testing.AbstractMojoTestCase.setUp(AbstractMojoTestCase.java:118)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.plugins.surefire.report.SurefireReportMojoTest.setUp(SurefireReportMojoTest.java:56)
>>>>     at junit.framework.TestCase.runBare(TestCase.java:139)
>>>>     at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>>     at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>>     at junit.framework.TestResult.run(TestResult.java:125)
>>>>     at junit.framework.TestCase.run(TestCase.java:129)
>>>>     at junit.framework.TestSuite.runTest(TestSuite.java:252)
>>>>     at junit.framework.TestSuite.run(TestSuite.java:247)
>>>>     at
>>>>
>>>>
>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
>>>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>     at
>>>>
>>>>
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>     at
>>>>
>>>>
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>     at java.lang.reflect.Method.invoke(Method.java:497)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
>>>>     at
>>>>
>>>>
>>>> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
>>>>     at
>>>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>>>> Caused by: java.util.NoSuchElementException
>>>>     at java.util.Collections$EmptyIterator.next(Collections.java:4189)
>>>>     at
>>>>
>>>>
>>>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
>>>>     ... 25 more
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jan 7, 2016 at 6:10 PM, Robert Scholte <[email protected]>
>>>> wrote:
>>>>
>>>> Hi Tibor,
>>>>
>>>>>
>>>>> so this is not how it should be done.
>>>>> Compat contains classes which Maven2 classes which have been replaced
>>>>> by
>>>>> Maven3 or are not used anymore.
>>>>> Only plugins which need to stay compatible with Maven2 should include
>>>>> this
>>>>> dependency.
>>>>>
>>>>> I'll update the page, because we've decided to change the version to
>>>>> 3.0-SNAPSHOT
>>>>>
>>>>> And regarding your other message: see the third bullet when using
>>>>> maven-plugin-testing-harness. Use version 2.1 if you want to ensure
>>>>> that
>>>>> the tests are Maven 3.0 compatible.
>>>>>
>>>>> If you need help, just let me know. By now I can recognize most of the
>>>>> migration issues :)
>>>>>
>>>>> thanks,
>>>>> Robert
>>>>>
>>>>> Op Thu, 07 Jan 2016 00:50:10 +0100 schreef Tibor Digana <
>>>>> [email protected]>:
>>>>>
>>>>> P=NP
>>>>>
>>>>> maven-compat made the trick
>>>>>>
>>>>>> <dependency>
>>>>>>   <groupId>org.apache.maven</groupId>
>>>>>>   <artifactId>maven-compat</artifactId>
>>>>>> </dependency>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 7, 2016 at 12:09 AM, Tibor Digana-2 [via Maven] <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>> I missing this import in MOJO after migrating plugin to 3.0
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
>>>>>>>
>>>>>>> The doc [1] says that maven-artifact-transfer should be used but it
>>>>>>> does
>>>>>>> not have yet a release version, or?
>>>>>>>
>>>>>>> <dependency>
>>>>>>>   <groupId>org.apache.maven.shared</groupId>
>>>>>>>   <artifactId>maven-artifact-transfer</artifactId>
>>>>>>>   <version>0.0.1-SNAPSHOT</version>
>>>>>>> </dependency>
>>>>>>>
>>>>>>> [1]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> https://cwiki.apache.org/confluence/display/MAVEN/Plugin+migration+to+Maven3+dependencies
>>>>>>>
>>>>>>> --
>>>>>>> Cheers
>>>>>>> Tibor
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>> If you reply to this email, your message will be added to the
>>>>>>> discussion
>>>>>>> below:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://maven.40175.n5.nabble.com/migrating-Surefire-to-3-0-RC1-tp5858124.html
>>>>>>> To start a new topic under Maven Developers, email
>>>>>>> [email protected]
>>>>>>> To unsubscribe from Maven Developers, click here
>>>>>>> <
>>>>>>>
>>>>>>>
>>>>>>> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=142166&code=dGlib3JkaWdhbmFAYXBhY2hlLm9yZ3wxNDIxNjZ8LTI4OTQ5MjEwMg==
>>>>>>> >
>>>>>>> .
>>>>>>> NAML
>>>>>>> <
>>>>>>>
>>>>>>>
>>>>>>> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>>
>>>>>> http://maven.40175.n5.nabble.com/migrating-Surefire-to-3-0-RC1-tp5858124p5858130.html
>>>>>> Sent from the Maven Developers mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>> 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]
>
>


-- 
Cheers
Tibor

Reply via email to