Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3035

“Package […] does not exist” when including another project with generated sources as a Maven dependency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 11.1
    • None
    • None
    • Windows 10

    Description

      I have two projects:

      • Model generates Java files (.java/.class) from XSD files (via JAXB)
      • Service includes Model as a Maven dependency.

      Both projects compile fine. However, if Service includes Model with the current version, NetBeans cannot resolve references to Model in the Service project.

      For example, Service 1.0.0 uses Model 42.0.0. If my Model project specifies version 42.0.0 in the POM, NetBeans marks files in the Service project referencing classes from Model with a red icon and states “Package demo.model.foo does not exist” on the import statements. If I keep the dependency version in Service’s pom.xml at 42.0.0 and change the Model version in its POM to 42.0.1-SNAPSHOT, everything works fine.

      It is true that there are no *.java files in the Model project sources. These are generated and compiled when the Model project is compiled.

      Attachments

        Activity

          People

            Unassigned Unassigned
            striderapache dennis lucero
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: