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

[SPARK-27458][DOC] remind developers to reset maven home in IntelliJ #195

Closed
wants to merge 5 commits into from

Conversation

William1104
Copy link
Contributor

I tried to follow the guide at 'http://spark.apache.org/developer-tools.html' to setup an IntelliJ project for Spark. However, the project was failed to build. It was due to missing classes generated via antlr on sql/catalyst project even thought I clicked the 'Generate Sources and Update Folders For All Projects' button in IntelliJ as per suggested.

It turned out that I forgot to reset the maven home in my IntelliJ and the IntelliJ failed the 'Generate Sources and Update Folders For All Projects' action silently. That was why ANTLR4 files were not generated as expected.

To help other developers, I would like to enhance 'http://spark.apache.org/developer-tools.html' to add a note to remind developer to check if the 'Generate Sources and Update Folders For All Projects' action was failed silently due to incorrect maven version. If so, they should update the maven home in IntelliJ accordingly

@William1104 William1104 changed the title remind developers to reset maven home in IntelliJ [SPARK-27458][Documentation] remind developers to reset maven home in IntelliJ Apr 15, 2019
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

The tip is fine; a few suggestions here.

@@ -397,6 +397,18 @@ Other tips:
- "Rebuild Project" can fail the first time the project is compiled, because generate source files
are not automatically generated. Try clicking the "Generate Sources and Update Folders For All
Projects" button in the "Maven Projects" tool window to manually generate these sources.
- Maven bundled in IntelliJ may not meet the minimum version requirement of the Spark. If that happens,
Copy link
Member

Choose a reason for hiding this comment

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

"The version of Maven bundled with IntelliJ may not be new enough for Spark. ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review. Yes. I am going to change it.

2019-04-14 16:05:24,813 [ 314626] INFO - #org.jetbrains.idea.maven - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) on project spark-parent_2.12: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
java.lang.RuntimeException: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) on project spark-parent_2.12: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
```
in IntelliJ log file (`Help -> Show Log in Finder/Explorer`), you should reset the maven home directory
Copy link
Member

Choose a reason for hiding this comment

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

maven -> Maven
I don't think you need to look a IJ's log files; it's just an update to preferences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I am going to remove the verbose logs.

```
2019-04-14 16:05:24,796 [ 314609] INFO - #org.jetbrains.idea.maven - [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 3.3.9 is not in the allowed range 3.6.0.
2019-04-14 16:05:24,813 [ 314626] INFO - #org.jetbrains.idea.maven - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) on project spark-parent_2.12: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
Copy link
Member

Choose a reason for hiding this comment

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

Delete this and the next line; they're not that relevant

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

The tip is fine; a few suggestions here.

developer-tools.md Outdated Show resolved Hide resolved
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-27458][Documentation] remind developers to reset maven home in IntelliJ [SPARK-27458][DOC] remind developers to reset maven home in IntelliJ Apr 16, 2019
@William1104
Copy link
Contributor Author

Hi @dongjoon-hyun and @srowen, thanks for those suggestion. I just update the PR accordingly. I hope it looks better.

the action "Generate Sources and Update Folders For All Projects" could fail silently.
Please remember to reset the Maven home directory
(`Preference -> Build, Execution, Deployment -> Maven -> Maven home directory`) of your project to the
version is new enough.
Copy link
Member

Choose a reason for hiding this comment

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

"the version is new enough" -> "to point to a newer installation of Maven".

I might also tell people to install the latest version of Maven locally, or use the copy that Spark downloads into build/.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Just updated. I prefer suggesting ppl using the copy Spark downloads at build/. Worry that the latest version may not work all the time. For example, Maven 4 may not be backward compatible with Maven 3.

the action "Generate Sources and Update Folders For All Projects" could fail silently.
Please remember to reset the Maven home directory
(`Preference -> Build, Execution, Deployment -> Maven -> Maven home directory`) of your project to
point to a newer installation of Maven. You may also build Spark with script `build/mvn` first.
Copy link
Member

Choose a reason for hiding this comment

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

with script -> with the script
install a proper Maven -> install a recent version of Maven

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I updated the developer-tools.md accordingly, but not yet run the build to update corresponding html yet. Will do that tonight when I can access a desktop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

site/developer-tools.html is also updated. please kindly take a look.

@srowen srowen closed this in b4e0afa Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants