Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UiBinder file location in gwt-lib artifacts #33

Closed
timeu opened this issue Sep 18, 2015 · 7 comments
Closed

UiBinder file location in gwt-lib artifacts #33

timeu opened this issue Sep 18, 2015 · 7 comments

Comments

@timeu
Copy link

timeu commented Sep 18, 2015

I guess this is by design but probably should be documented:

In a gwt-lib library one has to put the UiBinder files (i.e. SomeView.ui.xml) into the resources/PACKAGE folder, so that they are packaged when running mvn package.
If they UIBinder files are in the src/main/java/PACKAGE folder, they are not packaged.

@tbroyer
Copy link
Owner

tbroyer commented Sep 18, 2015

Even if you explicitly declare src/main/java as a <resource> in your POM?

(unfortunately, I have no idea why I have added the **/*.java include filter: 4491107)

Maybe we should rather just remove it as src/main/java would work OK in a gwt-app, and more importantly also in a gwt-lib when in a reactor project with gwt:codeserver or gwt:devmode (as they directly add the source roots to the classpath); and this is also what source:jar would do AFACT.

@timeu
Copy link
Author

timeu commented Sep 18, 2015

I didn't try to declare it explicitly (I removed it when moving from the "official" gwt-maven-module to your's) but I guess it should work fine if I do (can try it if you like).

I stumbled over this when I tried to run mvn package on a reactor project that consists of a gwt-lib library and a sample project that uses the library. I got this error:

[INFO]    Computing all possible rebind results for 'com.github.timeu.gwtlibs.gwasgeneviewer.client.SettingsPanel.Binder'
[INFO]       Rebinding com.github.timeu.gwtlibs.gwasgeneviewer.client.SettingsPanel.Binder
[INFO]          Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[INFO]             [ERROR] Unable to find resource: com/github/timeu/gwtlibs/gwasgeneviewer/client/SettingsPanel.ui.xml
[INFO]    [ERROR] Errors in 'com/github/timeu/gwtlibs/gwasgeneviewer/client/SettingsPanel.java'
[INFO]       [ERROR] Line 26: Failed to resolve 'com.github.timeu.gwtlibs.gwasgeneviewer.client.SettingsPanel.Binder' via deferred binding
[INFO]    [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[INFO]       [WARN] com.github.timeu.gwtlibs.gwasgeneviewer.client.SettingsPanel_BinderImpl

When I move the SettingsPanel.ui.xml to the resources folder it works fine.

However as you said, running gwt:devmode on the reactor project works fine even when the UIBinder files are in src/main/java.

@timeu
Copy link
Author

timeu commented Sep 18, 2015

There is also another issue when the UiBinder files are in resources/PACKAGE when running dev-mode. Changes to the UIBinder won't be picked up when recompiling. This works if they are in src/main/java. So I guess either we remove the filter or add **/*.gwt.xml.

@tbroyer
Copy link
Owner

tbroyer commented Sep 18, 2015

There is also another issue when the UiBinder files are in resources/PACKAGE when running dev-mode. Changes to the UIBinder won't be picked up when recompiling. This works if they are in src/main/java.

This is a feature ;-)

Resources can be "filtered", so they have to be processed by resources:resources. This can possibly done automatically by your IDE (IIRC, Eclipse does this)

I think we should just remove the filter.

@ibaca
Copy link
Contributor

ibaca commented Sep 18, 2015

I get into the same situation after migrating from mojo gwt-maven-plugin, I created this issue #32 but as @tbroyer said, just adding the resources solves the problem. But, if this problem is common from people coming from mojo plugin, probably removing the filter or adding some warning if ui.xml o gwt.xml are found in sources might be nice.

@tbroyer
Copy link
Owner

tbroyer commented Sep 19, 2015

Ah right. I hadn't realized at the time that the behavior would be different between gwt-app and gwt-lib, and between gwt:compile and gwt:codeserver/gwt:devmode. I also think the plugin should not check whether a "conflicting" resource exists when adding src/main/java, for the same reason: source roots are added to the classpath of the compiler, devmode and codeserver, where there's no filter (the alternative would be to copy the source roots and add the copy to the classpath, and continuously watch the source roots and sync the changes to the copy; I refuse to do such a thing).

@tbroyer
Copy link
Owner

tbroyer commented Sep 27, 2015

Fixed by a15aa99, and released in 1.0-rc-3.

@tbroyer tbroyer closed this as completed Sep 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants