But when maven plugin tries to build it I get:
[WARN]
Widget class com.vaadin.addon.cssinject.client.VCSSInject was not found. The component com.vaadin.addon.cssinject.CSSInject will not be included in the widgetset.
looking at the code it seems like TypeOracle is not finding VCSSInject although its class and java files are in the jar that my project depends on.
How do you add stuff to the vaadin and gwt maven plugins’ classpaths?
(because having a compiletime maven dependency seems not to be enough)
The code you made available does not seem to be complete: the pom.xml is lacking the reference to the gwt-maven-plugin and more, and the widgetset file is not there.
You should first check that your widgetset file is in the correct location (here com.vaadin.addon.cssinject - the parent of the client package). I don’t remember if the entry-point statement is needed with Vaadin 6.2, it is not needed with more recent versions (as long as you are using gwt-maven-plugin 1.3-SNAPSHOT) and must be removed for 6.4.
With Maven, you cannot really manually add things on the classpath without resorting to very un-maven-like tricks - normally everything should come via maven dependencies and the standard Maven project structure.
Note also that the package name com.vaadin is reserved for addons from Vaadin Ltd, please use either your own package name or org.vaadin . See the
Terms of service, point 21 on trademarks for more information.
Thanks a lot for the feedback Henri!
I did manage to get it working eventually.
As some point I changed the package name from css_inject to cssinject when suspecting that the typeOracle does not like underscores in package names. Then I forgot to update the relevant part in my pom to copy the java source file into the jar.
Yes its a jar not a sample webapp, so the gwt-maven-plugin is not needed.
the widgetset is in
src/main/resources/com/vaadin/addon/cssinject/widgetset/CSSInjectApplicationWidgetset.gwt.xml
Thanks for clearing that up. (I just copied the code Jouni provided that used the following package: com.vaadin.addon.chameleon.editor.client).
I’ll fix that up now.
Hi, I also have this funny issue and I did have a funny solution for this. I just post it here as it might help others.
When I export a jar file with ONLY compiled classes, it will cry about Vsomething not found. However, if you include both the class files and java files in the jar, it will work
What I did to build a plugin jar file using eclipse:
-Add public/styles.css file in the same directory with the gwt.xml file and mention it in this file:
-Export as jar file, choose both options: ‘‘Export generated class file’’ and ‘Export java source file’
-In manifest section, choose option ‘from existing Manifest file’ and point to a created Manifest.mf with the content:
Yes, for GWT compilation to work, you need to have both the compiled server side classes and the sources of the client side classes on the GWT compiler classpath. The former are needed to scan for the available widgets based on server-side @ClientWidget annotations, and the latter as the GWT compiler compiles the widgetset from Java sources.
I am working with Netbeans 7.1 and Vaadin 6.8.5. With the ant build-widgetset.xml I can recompile the widgetset without issues, but if trying to develop a new component extending and existing GWT widget, the compiler won’t find the java sources necessary to compile in javascript the VComponent class…
My guess: Unless you have configured your widgetset (.gwt.xml) otherwise, the client side classes must be in a package called “client” under the package where the widgetset file is located. Maybe your client side classes are in the wrong location if the classpath correctly includes the sources of the client side files.
I accidentally solved it but wasn’t aware that the client package must be contained in the package where the module file is placed in the widgetset compilation. That was my mistake. After checking how some simple addons where arranged I tested a couple of combinations and finally got it working.
I double checked it and behaves as you have explained. If you place the module file somewhere else the sources won’t be found, hence the widget not being included in the widgetset.
How can you specify alternative locations for the client java sources in the module file? I have been reading some GWT manuals but that option hasn’t showed up yet.