Composite components in an external JAR are not recognized in Netbeans

后端 未结 1 960
攒了一身酷
攒了一身酷 2021-01-13 17:29

I have packaged a number of composite components in a JAR. However, when using them in another project (using Maven), Netbeans editor puts red error lines under lines which

1条回答
  •  隐瞒了意图╮
    2021-01-13 17:51

    I have absolutely the same problem. In my case it depends on the /src/main/java folder. If it's exist (only in the project and not even in the jar) the project which includes this library shows the "No library found for namespace... " When i remove the "java" folder it works. But then my backing bean class is missed in the jar...

    Tried with Netbeans 7.2 and 7.3, maven 2

    Solution:

    1. Generate a second project which contains the Java source files. (called: jsf-lib-java)
    2. In jsf-lib project (your composite component project with xhtml) delete the "java" folder and all *.java sources.
    3. add in the jsf-lib pom.xml following configuration:


    
        org.apache.maven.plugins
        maven-dependency-plugin
        
          
            unpack
            generate-resources
            
              unpack
            
            
              
                
                  com.mycompany.project
                  jsf-lib-java
                  1.0-SNAPSHOT
                  jar
                  true
                  src/main/
                  **/*.class
                
              
            
          
        
      
    

    That's it. This will generate a "good" jar file with the required *.class files. So it's possible to "trick" Netbeans.

    Now i work with this solution. It's a hack but didn't found a better solution.

    0 讨论(0)
提交回复
热议问题