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

fix: Update Maven wrapper and document its use to fix version resolution #7620

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

vvcephei
Copy link
Member

@vvcephei vvcephei commented Jun 2, 2021

Description

Update the wrapper to include confluentinc/maven#1
Document what the wrapper does, and how to use it on the CLI and in IDEs

Testing done

I verified the wrapper works as expected by doing:

mvn clean
rm -r ~/.m2/repository
./mvnw clean compile

This build completes in about 12 minutes with the wrapper, and takes a few hours without it. I can also visually verify that I'm not downloading extra pom files.

I also followed the documentation included in this PR to update IDEA and verified that it also doesn't resolve the extra dependencies (and that it also takes about 12 minutes to complete, instead of hours).

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@vvcephei vvcephei requested a review from a team as a code owner June 2, 2021 04:14
@ghost
Copy link

ghost commented Jun 2, 2021

@confluentinc It looks like @vvcephei just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@vvcephei vvcephei requested a review from xli1996 June 2, 2021 04:14
@vvcephei vvcephei self-assigned this Jun 2, 2021
@@ -1,4 +1,4 @@
# custmized maven that help avoid download only highest poms from version range
# https://issues.apache.org/jira/browse/MRESOLVER-164
distributionUrl=https://confluent-packaging-tools.s3-us-west-2.amazonaws.com/apache-maven-3.6.3.1-bin.zip
distributionUrl=https://confluent-packaging-tools.s3-us-west-2.amazonaws.com/apache-maven-3.8.1.2-bin.zip
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the version @xli1996 kindly built after merging confluentinc/maven#1.

Comment on lines +12 to +26
Development versions of KSQL use version ranges for dependencies
on other Confluent projects, and due to
[a bug in Apache Maven](https://issues.apache.org/jira/browse/MRESOLVER-164),
you may find that both Maven and your IDE download hundreds or thousands
of pom files while resolving dependencies. They get cached, so it will
be most apparent on fresh forks or switching to branches that you haven't
used in a while.

Until we are able to get a fix in and released officially, we need to work
around the bug. We have added a Maven wrapper script and configured
it to download a patched version of Maven. You can use this wrapper simply by
substituting `./mvnw` instead of `mvn` for every Maven invocation.
The patch is experimental, so if it causes you some trouble, you can switch
back to the official release just by using `mvn` again. Please let us know
if you do have any trouble with the wrapper.
Copy link
Member Author

Choose a reason for hiding this comment

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

I felt like some kind of context would be really nice for newcomers to the codebase.

back to the official release just by using `mvn` again. Please let us know
if you do have any trouble with the wrapper.

You can also configure IntelliJ IDEA to use the patched version of Maven.
Copy link
Member Author

Choose a reason for hiding this comment

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

This will probably be welcome news for devs. Hopefully, it works as expected! I have been having a couple of odd problems today, but I think it's just because master is somewhat broken right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice~

### Building and running KSQL locally

To build and run KSQL locally, run the following commands:

```shell
$ ./mvnw clean package -DskipTests -DversionFilter
$ ./mvnw clean package -DskipTests
Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessary anymore!

Comment on lines +62 to +71
#### Running in an IDE

You can create a run configuration in your IDE for the main class:
`io.confluent.ksql.rest.server.KsqlServerMain`, using the classpath
of the `ksqldb-rest-app` module, and specifying the path to a config
file as the program argument. There is a basic config available in
`config/ksql-server.properties`.

You may wish to be sure you have already configured your IDE to use
the Maven wrapper (see "About the Apache Maven wrapper", above).
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated, but I felt it was a bummer to have to read through ksql-server-start to figure out which class to run in IDEA.

Copy link
Contributor

@lct45 lct45 left a comment

Choose a reason for hiding this comment

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

Lots of good new information 🙌🏻

@vvcephei vvcephei merged commit 535fc09 into master Jun 2, 2021
@vvcephei vvcephei deleted the fix-maven-resolution branch June 2, 2021 16:44
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.

None yet

3 participants