spring-bootnetbeansmaven-3cisco-axlnetbeans-12

Spring Boot project (Maven) with AXL - NetBeans cannot find generated AXL packages/classes


A Spring Boot project (Maven) using AXL (Schema 12.5), I use NetBeans 12 as development environment.

I can build the project, it builds successful, the target-forder containts the generated AXL classes, etc., but NetBeans still shows errors in the editor, for example on all those import-statements on the AXL classes like

import com.cisco.axl.api._12.RLine;

The errors are, for example:

package com.cisco.alx.api._12 does not exist

All appearances of usage of AXL artifacts are marked as errors, like:

cannot find symbol
symbol: RLine

Why is that problem in the editor? How to configure?

Because of the errors I cannot use the auto-completion, there are no suggestions on what methods are available, etc.

The target-folder is structured like this:

- target
  ...
  - generated
    - cxf (below this start the packages: com.cisco.axl...)
  ...

Solution

  • The solution is, or at least a solution, to modify the pom.xml file, like so:

    ...
    <build>
        <resources>
           ...
            <resource>
                <directory>target/generated/cxf</directory>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
            </resource>
        </resources>
    </build>
    ...
    

    Now the import statements of the generated AXL Java classes work, no errors anymore!

    Let's go NetBeans, let's go!