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

Various issues when importing Axon in Eclipse #2865

Open
nils-christian opened this issue Oct 11, 2023 · 6 comments
Open

Various issues when importing Axon in Eclipse #2865

nils-christian opened this issue Oct 11, 2023 · 6 comments
Assignees
Labels
Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.

Comments

@nils-christian
Copy link
Contributor

Hi,

This was originally part of #2855, but I think this deserves an own issue. The described issues occur when importing the current axon-4.8.x branch, but the basic problems should be viable for the main branch as well.

If I open the current axon-4.8.x branch in Eclipse, I am already greeted by two compile errors:

image

Not sure why. The project itself is recognized by Eclipse as JDK8 project.

This already makes it difficult if not impossible to develop anything.

Now I would try and perform a local "mvn install" with skipped tests, so that I can build the project as fast as possible and close the problematic modules (which works fine, as long as I don't want to develop within the modules with the compile errors).

If one does not have the modules already in the local maven repository, this fails:

image

Now I have only one chance - to build the project with enabled tests. This, by the way, forces me already to have a docker environment and everything. So I try a "mvn install" without skipping the tests. If one of the tests fails, I am out of luck. I guess I could make sure that surefire continues after a fail, but...well...

image

At least when using Eclipse, the hurdle to develop for the Axon framework is rather high. I know, I have provided PRs in the past, but to be honest, due to this issues this has become rather cumbersome.

We usually have a quick-install maven profile in our builds which allow to build the project very quickly without running the tests or additional checks.

Best regards

Nils

@nils-christian nils-christian added the Type: Enhancement Use to signal an issue enhances an already existing feature of the project. label Oct 11, 2023
@smcvb smcvb added the Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. label Oct 19, 2023
@smcvb smcvb added this to the Release 4.9.1 milestone Oct 19, 2023
@smcvb
Copy link
Member

smcvb commented Oct 19, 2023

Thanks for filing this with us, @nils-christian.

I'm afraid I can't get this resolves or looked at right away, but will try to soon.
That would, likely, make it a change we introduce in Axon Framework 4.9.1.
As such, I've set the milestone to "Release 4.9.1".

@smcvb smcvb self-assigned this Dec 12, 2023
smcvb added a commit that referenced this issue Dec 13, 2023
Add quick-install maven profile, which skips tests

#2865
@smcvb
Copy link
Member

smcvb commented Dec 13, 2023

So, I've spent some time on this yesterday and today, so I have some feedback on the subject.

If I open the current axon-4.8.x branch in Eclipse, I am already greeted by two compile errors:
Not sure why. The project itself is recognized by Eclipse as JDK8 project.

After installing Eclipse on my laptop (I'm a Linux user btw), I opened the Axon Framework project to check whether I would get the same exception.
The referred to compile errors do not pop up, however...

So, perhaps it's a version thing? Honestly, I haven't used Eclipse since university, so this may be a stupid suggestion.
But, nonetheless, which version are you using, @nils-christian? Maybe I can reproduce it if I try to run the same.

Now I would try and perform a local "mvn install" with skipped tests, so that I can build the project as fast as possible and close the problematic modules (which works fine, as long as I don't want to develop within the modules with the compile errors).

Axon Framework's modules have test dependencies on one another for certain utilities.
Especially with the split between Spring Boot 2 and Spring Boot 3, it saved us tons of duplication.

Granted, I would prefer these to be collected in a dedicated module.
However, we're not there, so sharing is our best bet.

So, the build can skip the tests, but should still build the test code.

We usually have a quick-install maven profile in our builds which allow to build the project very quickly without running the tests or additional checks.

This made sense to me actually, so I added a quick-install profile (in this commit), which sets skipTests to true.

@smcvb
Copy link
Member

smcvb commented Dec 13, 2023

To give some additional clarity on the above.
I would still want to investigate why Axon Framework doesn't open up as intended in Eclipse.
In the meantime, if you could share whether the profile (however simple) already helps a little, that would be great, @nils-christian 🙏

@smcvb smcvb modified the milestones: Release 4.9.1, Release 4.10.0 Dec 13, 2023
@nils-christian
Copy link
Contributor Author

Hi @smcvb,

First of all: Thank you for taking the time to look into this issue.

So, I checked out Axon (revision 4deda0c) and installed a new Eclipse with the following version:

Eclipse IDE for Java Developers (includes Incubating components)
Version: 2023-12 (4.30.0)
Build id: 20231201-2043
OS: Windows 10, v.10.0, x86_64 / win32
Java vendor: Eclipse Adoptium
Java runtime version: 21.0.1+12-LTS
Java version: 21.0.1

I removed all Axon dependencies from my local Maven repository, imported the project into Eclipse and performed a full build via build automatically. The compiler shows four errors:

image

I do agree however, that the same issues to not appear in IntelliJ (or in a Maven build), so this seems to be an issue entirely with Eclipse's internal compiler (JDT). Taking a look at the bug list from JDT, it seems that there are indeed issues regarding generics, especially when raw/wildcard and actual generics are mixed. If I change the signature of EventBusSpanFactory.propagateContext from accepting EventMessage<T> to EventMessage<?>, the error is resolved. Very weird behaviour of JDT. I am not sure what should be done about this. It seems wrong (and not very feasible regarding the maintainability) to change the code in any way just to work around a bug of the JDT.

I also tested the quick install profile by running "mvn install --activate-profiles quick-install". A lot of tests are skipped in this run, but not the one in spring-boot-3-integrationtest. Those also fail if the system does not provide a running Docker environment.

I hope this helps.

Best regards

Nils

@smcvb
Copy link
Member

smcvb commented Dec 18, 2023

Awesome feedback, @nils-christian: this is very helpful.

I'll make adjustments to the profile to ensure it does not pick up the spring-boot-3-integrationtest module.
And, check whether I have missed skipping any other tests too.

Concerning the JDT of Eclipse, that's a bummer, actually.
Do you, perchance, have the issue reference at hand for Eclipse?
It would be nice to collect that info in this issue so that other readers can check it out.

@nils-christian
Copy link
Contributor Author

Hi @smcvb,

It is a little bit tricky to point to a single issue. Just searching for generics and wilcards in the bug list (https://bugs.eclipse.org/bugs/buglist.cgi?quicksearch=generics%20wildcards) or the specific error message (https://bugs.eclipse.org/bugs/buglist.cgi?quicksearch=Cannot%20infer%20type%20arguments) reveals various issues. A lot of them are also a little bit older without any activity.

Best regards

Nils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.
Projects
None yet
Development

No branches or pull requests

2 participants