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.

Bug 203794 - All templates with #key annotation attributes must use @Messages to build in Maven
Summary: All templates with #key annotation attributes must use @Messages to build in ...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 181355
  Show dependency tree
 
Reported: 2011-10-17 05:56 UTC by rptmaestro
Modified: 2011-11-17 07:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2011-10-17 05:56:41 UTC
Using Dev build from 201110140600
Steps to reproduce:

1.) Create a NetBeans Module *Maven* project
2.) Use the "File Type..." wizard to create a new file type.
3.) Build the project.

On my example project, I get the compilation error:

org/netbeans/modules/xquery/mavenproject1/MyFormatDataObject.java:[38,41] error: Cannot find resource org/netbeans/modules/xquery/mavenproject1/Bundle.properties

The file does, however, exist under src/main/resources. However, if I copy the file to the same package under src/main/java, the project will then build without the error.
Comment 1 Jesse Glick 2011-10-24 17:33:05 UTC
Reproducible using RELEASE71-BETA. ${name}VisualElement compiles since it using @Messages, but ${name}DataObject for whatever reason is not, and MultiViewProcessor is not finding src/main/resources/**/Bundle.properties.

If both use @Messages, it is OK; and if neither use @Messages, it is OK; but compilation breaks in LayerBuilder.validateResource if just one class in the package uses @Messages but the other does not. The reason is that due to a bug in javac the Maven compiler plugin does not pass src/main/resources in -sourcepath, but expects to find the bundle key in target/classes. That apparently does not work if some of the bundle is generated by @Messages.
Comment 2 Jesse Glick 2011-10-24 17:51:24 UTC
core-main #21b8e09e0312
Comment 3 Quality Engineering 2011-10-25 14:26:59 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/21b8e09e0312
User: Jesse Glick <jglick@netbeans.org>
Log: #203794: Can't find resource bundle for new file type nb module maven project
Comment 4 Jesse Glick 2011-11-11 17:39:51 UTC
Need to use @Messages for all templates using annotations, or mixture will not build under Maven. Currently some templates use @Messages for anno attrs like displayName but others do not.
Comment 5 Jesse Glick 2011-11-16 18:03:07 UTC
core-main #10c9015ab9ec
Comment 6 Quality Engineering 2011-11-17 07:27:18 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/10c9015ab9ec
User: Jesse Glick <jglick@netbeans.org>
Log: #203794: All templates with #key annotation attributes must use @Messages to build in Maven