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

Exclude Lucene's own JAR files from classpath entries in Eclipse config #976

Merged
merged 3 commits into from
Jun 24, 2022

Conversation

uschindler
Copy link
Contributor

This PR fixes the Eclipse task to exclude Lucene's own JAR files. I think this problem was introduced when we switched to module system, previously the project dependencies were just directories with class files, now it is lucene's JAR files.

This PR is a bit hacky, it applies regex to filename. @dweiss: If you have a better idea how to exclude project dependencies, tell me.

@uschindler uschindler added the bug label Jun 24, 2022
@uschindler uschindler self-assigned this Jun 24, 2022
@uschindler uschindler requested a review from dweiss June 24, 2022 09:57
@uschindler
Copy link
Contributor Author

The reason for this fix is to remove:

  • compile problems (sometimes it complains about duplicate class files). This also leads to problems when some aleady compiled code does not get recompiled due to the fact that it cannot see the change (as it refers to JAR instead of Eclipse's project output). This brings strange errors.
  • when you open a type it always brings multiple matches (one in JAR file and the other one in source tree). This is anoying

@dweiss
Copy link
Contributor

dweiss commented Jun 24, 2022

I'll take a look later today, Uwe.

@dweiss
Copy link
Contributor

dweiss commented Jun 24, 2022

Hi Uwe. This looks fine for me. Ideally, this should scan the dependencies and exclude project dependency artifacts (this is possible) but it adds a whole lot of code and achieves pretty much the same effect. I don't think the complexity is worth the gain here, as mentioned in the comment.

            // This is hacky - we take the resolved compile classpath and just
            // include JAR files from there. We should probably make it smarter
            // by looking at real dependencies. But then: this Eclipse configuration
            // doesn't really separate sources anyway so why bother.
            jars += prj.configurations.compileClasspath.resolve()
            jars += prj.configurations.testCompileClasspath.resolve() 

@uschindler uschindler merged commit eafc642 into apache:main Jun 24, 2022
@uschindler uschindler deleted the gradle/eclipse_no_lucene_jars branch June 24, 2022 17:42
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.

2 participants