[
https://issues.apache.org/jira/browse/IOTDB-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiangdong Huang reassigned IOTDB-1198:
--------------------------------------
Assignee: Eric Pai
> Add generated-sources as source folder
> --------------------------------------
>
> Key: IOTDB-1198
> URL: https://issues.apache.org/jira/browse/IOTDB-1198
> Project: Apache IoTDB
> Issue Type: Task
> Components: Others
> Reporter: Eric Pai
> Assignee: Eric Pai
> Priority: Minor
> Labels: needs-review, pull-request-available
> Fix For: 0.12.0
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> h1. Description
> The generated source files in _thirft/target/generated-sources_ and
> _antlr/target/generated-sources_ can't be auto discovered by IDEs like VSCode
> and IntelliJ IDEA.
> In IDEA, we can solve this by following the instructions in
> [https://iotdb.apache.org/Development/ContributeGuide.html#_2-iotdb-debugging-method].
> However, this can't be applied in VSCode Java plugin because adding a folder
> to Java source path is forbidden in a maven project. The error output is
> *Unsupported operation. Please use pom.xml file to manage the source
> directories of maven project*.
> h1. Solution
> Use *build-helper-maven-plugin* to add the folder to sources in
> *generate-sources* phase.
> Influenced modules:
> - antlr
> - thrift
> If this PR is accepted, I will submit another one to update the docs.
> h1. Note
> We must use
> {code:java}
> ${project.build.directory}/generated-sources/antlr4{code}
> instead of
> {code:java}
> ${project.build.outputDirectory}/../generated-sources/antlr4{code}
> The resaons are:
> 1. Although the two paths refer to the same dictionary, their string
> representations are different. e.g.
> _antlr/target/classes/../generated-sources/antlr4_ and
> _antlr/target/generated-sources/antlr4_.
> 2. It seems that *javac* of JDK8 will not simplify the source path, thus a
> *duplicate class* compilcation error occurs.
> 3. JDK11 and 15 fixed this issue(I guess).
> See this CI result: [https://github.com/apache/iotdb/actions/runs/635878512]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)