0

I don't understand why I am getting 'Cannot find symbol' error on files that have been excluded from the build path.

All references to any of the classes or methods of excluded classes have been commented out. No errors or significant warnings:
List of problems/warnings: enter image description here

Project build exclusion:
enter image description here

Compilation output:

[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[54,32] error: cannot find symbol [ERROR] symbol: method getTableByID(UUID) location: variable ddrInterface of type DomainInterfaceImpl C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[128,43] error: cannot find symbol [ERROR] symbol: method getSourceDDRColumn() location: variable datapointSource of type DatapointSource C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[147,67] error: cannot find symbol [ERROR] symbol: method getArithmeticDatapoints() location: variable datapointSource of type DatapointSource C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[151,68] error: cannot find symbol [ERROR] symbol: method getSourceDDRColumn() location: class DatapointSource C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[152,64] error: cannot find symbol [INFO] 5 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.489 s [INFO] Finished at: 2021-03-29T11:33:41-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ingest: Compilation failure: Compilation failure: [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[54,32] error: cannot find symbol [ERROR] symbol: method getTableByID(UUID) [ERROR] location: variable ddrInterface of type DomainInterfaceImpl [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[128,43] error: cannot find symbol [ERROR] symbol: method getSourceDDRColumn() [ERROR] location: variable datapointSource of type DatapointSource [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[147,67] error: cannot find symbol [ERROR] symbol: method getArithmeticDatapoints() [ERROR] location: variable datapointSource of type DatapointSource [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[151,68] error: cannot find symbol [ERROR] symbol: method getSourceDDRColumn() [ERROR] location: class DatapointSource [ERROR] C:\Users\dorr\git\ddr-ingest\src\main\java\com\biogen\ddr\ingest\model\TableBuilderInstruction.java:[152,64] error: cannot find symbol [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 
2
  • 1
    Why are you trying to exclude source from compilation? Commented Mar 29, 2021 at 16:41
  • Because the client has decided a the last moment not to include a feature in deployment. Commented Mar 30, 2021 at 18:34

1 Answer 1

1

Your second screenshot shows you have configured exclusion patterns in Eclipse, but your third screenshot shows compile errors against the source you are trying to exclude, but you're compiling with Maven, not the IDE.

You need to configure your exclusion patterns for the compiler plugin in Maven, in your pom.xml file. This is described here Maven: excluding java files in compilation

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.