maven compilation failure

前端 未结 18 2200
不知归路
不知归路 2020-12-07 17:57

I have a weird problem - Some class file couldn\'t be read during maven build.

  1. I have a project A and project B.
  2. Project
18条回答
  •  Happy的楠姐
    2020-12-07 18:28

    I had a similar problem, and never find anything on the web after excessive searching.

    I reviewed the pom.xml file and in the dependencies I changed the scope of the it: test to compile .

    Previously I was using it only for tests but I change the project's structure and never knew I hve to change this.

    test: This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.

    compile: This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.

    Here is a reference from Apache Maven Docs: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

提交回复
热议问题