Home > Mobile >  the declared package does not match the expected package
the declared package does not match the expected package

Time:09-21

I have imported a maven project from git. As the sources were not seen I add the src directories as sources. Maven compiles correctly. But In Eclipse I have the error.

Tthe declared package com.mypackage does not match the expected package src.main.java.com.mypackage

I have another error when updating import and I think it is a result of this :

project roots is not on it's project build path"

CodePudding user response:

In the traditional Maven structure (which this project seems to have), src isn't the root of the sources. Under it, you'll find (up to) two folders:

  1. src/main/java is the source root for the "production" code
  2. src/test/java is the source root for the test code.

CodePudding user response:

See Maven / Introduction to the Standard Directory Layout:

src/main/java Application/Library sources
... ...
  • Related