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

Enforce DependencyConvergence in parent pom #385

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

aldenquimby
Copy link
Contributor

Enforce dependency convergence in parent pom. Runs during validate phase, which is the default for the plugin.

Changes needed to get convergence passing:

  • downgrade slf4j.version from 1.7.9 to 1.7.6 so that it lines up with dependencies
    • only used for slf4j-nop, so I figured version doesn't matter
  • exclude morfologik-polish from morfologik-speller
  • pull guava, commons-lang, junit up to parent dependencyManagement to resolve most convergence issues
  • add special dependencyManagement to languagetool-dev because there are so many more conflicts there than any other package

See #342 (comment) for additional context

@aldenquimby
Copy link
Contributor Author

@danielnaber here is a PR based on your comment on #342. The two main ways to fix convergence issues are:

  • add exclusions to dependencies
  • add dependencyManagement entry

Happy to rework this in either direction if you'd prefer one or the other. Exclusions can get pretty ugly if 3 or more dependencies have conflicting transitive dependencies

@danielnaber danielnaber merged commit 4081769 into languagetool-org:master Apr 7, 2016
@danielnaber
Copy link
Member

Thanks. All Hadoop-related classes could maybe be moved to their own languagetool-dev-hadoop module, but that's an item for the long-term TODO list.

@danielnaber
Copy link
Member

This seems to have a side-effect that we cannot run tests inside modules anymore, as then the validation will fail (e.g. in languagetool-dev and language-modules/de). Is this by design?

@aldenquimby
Copy link
Contributor Author

No, that wasn't intentional. When I run mvn validate from within languagetool-language-modules/de, it works correctly - what error are you seeing?

@danielnaber
Copy link
Member

I see this result: https://gist.github.com/danielnaber/12c546f821a4c659a01335935b211682, my maven version is 3.2.5

@aldenquimby
Copy link
Contributor Author

Here is my output from running mvn validate within languagetool-language-modules/de:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building German module for LanguageTool 3.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ language-de ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-dependency-convergence) @ language-de ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.088 s
[INFO] Finished at: 2016-04-08T12:19:46-04:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------

I think you might be having an issue specific to snapshots. You might have a cached version of languagetool-core in your remote or local repository, which is missing this change.

What do you get if you run the following from git root:

mvn validate -am -pl languagetool-language-modules/de

I think you could also fix this by running mvn clean install -DskipTests -DskipITs from the langaugetool-core directory, which would ensure your local repo has the correct snapshot version of core.

That said, it may make sense to either:

  • move the enforcer to the verify phase, so that it never runs during normal development, and only runs after packaging (I think this is common)
  • only turn on the enforcer on certain modules instead of globally for the project

@danielnaber
Copy link
Member

You're right, mvn install fixed the issue. Having validation only during packaging would be better, especially as it takes some time and we already suffer from our slow tests. Having it on for everything except languagetool-dev also makes sense. If you could create a pull requests for these changes that would be great.

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