Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUREFIRE-1628] fix compatibility with maven 3.0.5 #274

Closed
wants to merge 1 commit into from
Closed

[SUREFIRE-1628] fix compatibility with maven 3.0.5 #274

wants to merge 1 commit into from

Conversation

joergsesterhenn
Copy link

As advised by @rfscholte and suggested by @Tibor17 I created this pull request to fix compatibility with maven 3.0.5 by replacing injection of LocationManager with instantiation.

@Tibor17
Copy link
Contributor

Tibor17 commented Mar 6, 2020

Have you tried to install (i.e. mvn install -DskipTests) this patch in your local repo? How does it work for you (i.e. mvn -nsu test on your own project)?

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is the right fix.
You are bypassing dependency injection.

Why do you want this plugin to be compatible with obsolete Maven 3.0.5 ?
Can't you use a previous version ?

@Tibor17
Copy link
Contributor

Tibor17 commented Mar 27, 2020

@rfscholte
Do you expect any injection points in the class LocationManager (plexus-java)?
In the future?
Should it be a plain POJO?
Should it be a bean?

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 3, 2020

@eolivelli
Robert mentioned this option of instantiating this LocationManager instead of injecting it.
If Robert guarantees that future versions wouldn't use injections in the class LocationManager then we are on the safe side.

@rfscholte
Copy link
Contributor

I won't guarantee anything. Having it available as a bean gives me the freedom to inject other beans. So far there hasn't been a reason to do so.
I would suggest to try and get the LocationManager as bean. If it is null, create one yourself via the constructor. Once surefire requires Maven 3.1, you can drop the null-check.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 6, 2020

@eolivelli
@rfscholte
Do you think that it helps if we generate component.xml via plexus-component-metadata:generate-metadata in Maven 3.0.5? If we do not use JSR-330 in the MOJO, and we use Component annotation then this can be fixed by generating the component.xml. WDYT?

@michael-o
Copy link
Member

I'd go the simplest route: require 3.1 for Surefire 3.x
@joergsesterhenn Do you rely on Maven 3.0.x?

@joergsesterhenn
Copy link
Author

joergsesterhenn commented Apr 6, 2020 via email

@eolivelli
Copy link
Contributor

Don't know sorry.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 6, 2020

Unfortunately the Maven 3.0.x is not EOF yet, see the history:
http://maven.apache.org/docs/history.html

@michael-o
Copy link
Member

michael-o commented Apr 6, 2020

Unfortunately the Maven 3.0.x is not EOF yet, see the history:
http://maven.apache.org/docs/history.html

This is one of our serious problems I have raised on dev@ some months ago. We have no please policy how long something is support officially or at best effort. 7 years old release are more than enough.

@joergsesterhenn Can you tell why you still rely on it? Old product?

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 6, 2020

@joergsesterhenn
I have checked the code. Surefire does not generate components.xml using plexus-component-metadata. Pls rewrite the commit to generate this metadata file. I hope this would be the fix.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 6, 2020

I think the injection point should be moved from SurefireMojo to SurefirePlugin and IntegrationTestMojo. Try to add it in the POM in maven-surefire-common , and if it does not work then it would mean that you have to move it directly to the module of every MOJO class. Let's see what will happen...

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 15, 2020

@michael-o
Let's post this on @dev and require deprecating the MVN 3.0.x.
We have couple of reasons (JSR330, component injection) why it should be deprecated version.

@mosabua
Copy link
Member

mosabua commented Apr 15, 2020

Totally agree with deprecating 3.0 .. in fact I would deprecate 3.1 and probably 3.2 as well

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 16, 2020

@mosabua
yes, I would doo it too, even 3.3.x as well. We have updated all plugins to 3.0 and it was not easy job. IMO doing it with 3.1 would be as simple as updating the dependencies only and much easier than before. If we would do it systemematically, we would deprecate also 3.2, I am sure.

@elharo
Copy link
Contributor

elharo commented Apr 24, 2020

There's at least one plugin still back in 2.x somewhere, I forget which.

Updating from 3.0 to 3.1 is not simple in most cases. So far I've found one plugin where it was a one-liner. Usually it requires major work on the integration tests.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 24, 2020

@elharo
Right, but here we can take the easier path. i.e. to update the documentation as a starting point and wait for deprecating the Maven 3.0.x on Maven pages.
IMO the real fix for this issue would be simple. So I am not strictly against the fix either.

@elharo elharo changed the title SUREFIRE-1628 fix compatibility with maven 3.0.5 [SUREFIRE-1628] fix compatibility with maven 3.0.5 Feb 14, 2021
@slawekjaranowski
Copy link
Member

slawekjaranowski commented Jan 8, 2022

@Tibor17
Copy link
Contributor

Tibor17 commented Feb 4, 2022

Closing due to the project is currently based on Maven API 3.2.x.

@Tibor17 Tibor17 closed this Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants