This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Advantages: simpler build scripts, easier usage from Maven, easier versioning using build/generated, better dependency behavior.
Works fine for hibernate module. I can't do anything with j2ee.dd as it is because its build script uses Ant's <replace> to adjust signatures of the generated classes after S2B has run. Probably this should be fixed in the MDD (if necessary, enhancing S2B to be able to specify this).
While I will probably add a couple more miscellaneous attributes to the annotation corresponding to existing Ant task attributes which I find to be in use as I go through remaining modules, I think this is ready to review.
Created attachment 92401 [details] Current patch .hgignore | 15 apisupport.project/src/org/netbeans/modules/apisupport/project/NbModuleProject.java | 12 apisupport.project/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java | 37 apisupport.project/src/org/netbeans/modules/apisupport/project/queries/SourceForBinaryImpl.java | 31 apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/queries/SourceForBinaryImplTest.java | 16 hibernate/build.xml | 73 - hibernate/src/org/netbeans/modules/hibernate/cfg/model/package-info.java | 52 + hibernate/src/org/netbeans/modules/hibernate/mapping/model/package-info.java | 52 + hibernate/src/org/netbeans/modules/hibernate/reveng/model/package-info.java | 52 + j2ee.dd.webservice/build.xml | 71 - j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/model_1_1/package-info.java | 62 + j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/model_1_2/package-info.java | 62 + j2ee.jboss4/build.xml | 84 - j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/config/gen/package-info.java | 101 ++ j2ee.persistence/build.xml | 95 - j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_1_0/package-info.java | 55 + j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/orm/model_2_0/package-info.java | 55 + j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_1_0/package-info.java | 54 + j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/dd/persistence/model_2_0/package-info.java | 54 + j2ee.sun.dd/build.xml | 495 ---------- j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/api/cmp/package-info.java | 50 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/app/model_1_3_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/app/model_1_4_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/app/model_5_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/app/model_6_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/client/model_1_3_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/client/model_1_4_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/client/model_1_4_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/client/model_5_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/client/model_6_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/cmp/model_1_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/cmp/model_1_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/cmp/model_1_2/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/common/model_2_1_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/common/model_2_1_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/common/model_3_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_2_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_2_1_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_2_1_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_3_0_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_3_0_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/ejb/model_3_1_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/web/model_2_3_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/web/model_2_4_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/web/model_2_4_1/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/web/model_2_5_0/package-info.java | 54 + j2ee.sun.dd/src/org/netbeans/modules/j2ee/sun/dd/impl/web/model_3_0_0/package-info.java | 54 + j2eeserver/build.xml | 55 - j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/gen/nbd/package-info.java | 51 + nbbuild/antsrc/org/netbeans/nbbuild/CustomJavac.java | 7 nbbuild/javadoctools/links.xml | 1 nbbuild/javadoctools/properties.xml | 1 nbbuild/javadoctools/replaces.xml | 1 schema2beans/anttask/build.xml | 82 - schema2beans/build.xml | 55 - schema2beans/dev/build.xml | 138 -- schema2beans/dev/manifest.mf | 7 schema2beans/nbproject/project.properties | 6 schema2beans/nbproject/project.xml | 8 schema2beans/src/org/netbeans/modules/s2banttask/Schema2BeansAntTask.java | 3 schema2beans/src/org/netbeans/modules/schema2beans/Schema2Beans.java | 164 +++ schema2beans/src/org/netbeans/modules/schema2beansdev/DocDefParser.java | 21 schema2beans/src/org/netbeans/modules/schema2beansdev/EntityParser.java | 18 schema2beans/src/org/netbeans/modules/schema2beansdev/Schema2BeansProcessor.java | 206 ++++ 64 files changed, 2634 insertions(+), 1172 deletions(-)
re. "j2ee.dd uses Ant's <replace>" - it does because it was not possible to express requirements for generation via MDD files. Or maybe it was but nobody could figure out how to do that after reading MDD documentation. And because schema2beans is not really maintained or developed it was just hacked via <replace>. Somehow my impression was that s2b is dead. j2ee.dd will be needed in next decade but with each release of Java EE more and more configuration is moved to annotations so its less and less important.
Right - see bug 160049 on more background on introducing the Ant <replace>.
Well I am just leaving j2ee.dd alone; the Ant task still works as before (you only need the regular module JAR in the taskdef CP). S2B does not seem "dead" judging by the number of modules that still use it: fgrep -l schema2beans {,contrib/}*/{build.xml,nbproject/project.xml} You could try to deprecate it, limit access to specific friends, and try to remove some of the usages, but this seems like it could be a big project. I'm not sure what the replacement would be - JAXB? XOM? A Groovy internal DSL?
websvc.jaxrpc also does some postprocessing of results - in this case fairly minor and could perhaps be done in the MDD file, I don't know.
Created attachment 92551 [details] Latest, possibly final, patch
There are also a bunch of modules in contrib which I would probably try to convert after this patch is in main.
core-main #8ef29befd159
Converting contrib/j2ee.geronimo2 does not seem to work, perhaps due to a bug in s2b: the generated code has public DependencyType(int options) { super(comparators, runtimeVersion); which does not compile, compared to what used to be checked in: public DependencyType(int options) { super(options);
I do not know if this is the same problem but once I have commited a patch that fixed a similar problem in schema2beans. Probably it was not applied. https://netbeans.org/bugzilla/show_bug.cgi?id=157807
contrib/j2ee.blueprints is also difficult to make work since nbcatalog.dtd is extracted from a ZIP file; the annotation processor expects it to be in the source path.
contrib #5b7c153cea34 will fix j2ee.oc4j and j2ee.sun.ws7.
Integrated into 'main-golden', will be available in build *200912180200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/8ef29befd159 User: Jesse Glick <jglick@netbeans.org> Log: Issue #178426: Replace <schema2beans> with annotation processor. To support this, enhance harness & apisupport to handle generated sources.
Ignore "cannot find symbol" errors referring to model classes printed before the annotation processor has run; arguably a javac bug that these are displayed.