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

Source files in the target folder #55

Closed
natros opened this issue Mar 1, 2016 · 5 comments
Closed

Source files in the target folder #55

natros opened this issue Mar 1, 2016 · 5 comments

Comments

@natros
Copy link

natros commented Mar 1, 2016

Hi,

Sometimes after some refactoring the gwt compiler complains about some missing references. In this case what I do is to delete all java source files within the target folder. As far as I can tell, these java source files are copied during the import sources (gwt-maven-plugin:1.0-rc-6:import-sources). Is there any need to have the source code in the target folder since the same code exists in the src folder and is more up to date?

I'm using IntelliJ and when I change the name of a class, the IDE renames the java files in the src folder and renames the .class file in the target directory, but does not change the name of the .java file inside the target folder thus leaving these java files forever or until I delete them.

I understand that these files may be necessary for the gwt-lib, but I'm not so sure if they are needed for gwt-app

I'm using java 8, OSX, IntelliJ, last gwt 2.8 snapshot, and gwt:devmode

Thank you.

@natros
Copy link
Author

natros commented Apr 5, 2016

Hello,

After moving (IDE refactoring) the file certidao/CertidaoEstagioPanel.java to certificado/CertificadoEstagioPanel.java I'm getting

[INFO]    Job pt.ipb.suplemento.Suplemento_1_0
[INFO]       starting job: pt.ipb.suplemento.Suplemento_1_0
[INFO]       Compiling module pt.ipb.suplemento.Suplemento
[INFO]          Tracing compile failure path for type 'pt.ipb.suplemento.client.modulos.sup.certidao.CertidaoEstagioPanel'
[INFO]             [ERROR] Errors in 'file:/Users/fsousa/Projects/ipb/suplemento/suplemento-client/target/classes/pt/ipb/suplemento/client/modulos/sup/certidao/CertidaoEstagioPanel.java'
[INFO]                [ERROR] Line 10: The import pt.ipb.suplemento.shared.model.Item.CERTIDAO_ESTAGIO cannot be resolved
[INFO]                [ERROR] Line 59: CERTIDAO_ESTAGIO cannot be resolved to a variable
[INFO]          [ERROR] Aborting compile due to errors in some input files

I have to manually remove the source files from target

find target/classes -type f -name CertidaoEstagioPanel\*
target/classes/pt/ipb/suplemento/client/modulos/sup/certidao/CertidaoEstagioPanel.java
target/classes/pt/ipb/suplemento/client/modulos/sup/certidao/CertidaoEstagioPanel.ui.xml

@natros
Copy link
Author

natros commented Sep 23, 2016

ping

@dmg46664
Copy link

dmg46664 commented Apr 9, 2017

@natros - Looks like gwt-maven-plugindelegates to MavenResourceExecution.

I believe you're therefore asking for a feature request on that project to better synchronise resources, unless you can recommend a better alternative?

I don't have a good handle on why the target directory exists but it appears canonical. Probably it's necessary to support annotation processing or some such code and/or resource processing use case.

@tbroyer
Copy link
Owner

tbroyer commented Apr 10, 2017

FWIW, I'm still wondering what to do with those import-sources goals, and whether I should make a gwt:jar for libraries instead of marking source directories as resource directories too. This however means I would also need to change gwt:compile and gwt:test goals to use the source directories too.

BTW, the reason it's done this way today is:

  • because that's (probably) how you'd do it if the plugin didn't do it for you (i.e. declare src/mainjavaas a resources directory, and use theexec-maven-plugin` to run the GWT tools)
  • because if you'd do it that way, you possibly would want to make use of resource filtering (and the plugin currently ignores source directories that have been declared as resources directories, to explicitly permit those cases); though I believe one should not work this way (you should rather use the template-maven-plugin

So, I might very well move towards a gwt:jar goal, and gwt:compile and gwt:test adding the compile source roots to the classpath; and this is BTW the main reason this plugin isn't at 1.0 yet.

Closing now as I don't think there's anything actionable in this issue thread (and blame Maven –and possibly IntelliJ here– for broken incremental builds).

@tbroyer tbroyer closed this as completed Apr 10, 2017
@tbroyer
Copy link
Owner

tbroyer commented Apr 24, 2017

OK, so, gwt:package-lib (rather than gwt:jar) is finally here in 7c4e86a

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