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

mvn clean install adds files to presto-main/src #22685

Open
elharo opened this issue May 7, 2024 · 7 comments
Open

mvn clean install adds files to presto-main/src #22685

elharo opened this issue May 7, 2024 · 7 comments
Assignees
Labels

Comments

@elharo
Copy link
Contributor

elharo commented May 7, 2024

I've noticed that recently these new files keep showing up in my repo:

Untracked files:
(use "git add ..." to include in what will be committed)
presto-main/src/main/resources/webapp/dev/query_viewer.js
presto-main/src/main/resources/webapp/dist/

I think these belong instead in the generated-sources directory (or something like that; still need to fully debug and research this). I suspect they've been added as a result of #22645

@yhwang
Copy link
Member

yhwang commented May 7, 2024

These untracked files are from the #22645 (but they were not added by the PR, the PR removed them from the sources):

presto-main/src/main/resources/webapp/dev/query_viewer.js
presto-main/src/main/resources/webapp/dist/

@ZacBlanco also informed me about this issue
The possible solutions are:

  1. Add these files into .gitigonre
  2. Modify the webpack to generate compiled JS to presto-main/target directory

For solution 2, it may need to tweak the webpack config to cover the dev scenarios. Need to make sure yarn watch, yarn serve work with the new JS location.

@elharo
Copy link
Contributor Author

elharo commented May 8, 2024

#1 is not really a solution. #2 is a maybe. In the past I've seen these sorts of tools use a generated-sources directory though at the moment, I can't find any docs about that. However we definitely should not generate anything into src/main. We need to put generated code somewhere mvn clean will delete it.

@yhwang
Copy link
Member

yhwang commented May 8, 2024

@elharo

We need to put generated code somewhere mvn clean will delete it

That's option 2.

@elharo
Copy link
Contributor Author

elharo commented May 9, 2024

had to look in the maven-compiler-plugin source code but it likely belongs in

${project.build.directory}/generated-sources/

@yhwang
Copy link
Member

yhwang commented May 9, 2024

FYI, Presto is following the Maven stadnard directory layout: https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

@elharo
Copy link
Contributor Author

elharo commented May 10, 2024

Yes, and nothing in that layout is for generated code.

@yhwang
Copy link
Member

yhwang commented May 10, 2024

for .js files, they are equal to .class which would go to target/classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 Unprioritized
Development

Successfully merging a pull request may close this issue.

2 participants