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 path from Inherited GWT.xml files are not being considered #144

Closed
pratikthaker84 opened this issue Nov 4, 2020 · 13 comments
Closed
Labels
question Further information is requested

Comments

@pratikthaker84
Copy link

pratikthaker84 commented Nov 4, 2020

Hi Team,

I have below project structure

A

  • com.sample.gwt
    A.gwt.xml

B

  • com.sample.gwt.client
    B.gwt.xml

In B.gwt.xml I have below tag,

<inherits name="com.sample.gwt.A" />

In the module tag in my pom.xml, I have provided com.sample.gwt.client.B

I am facing below issue,

While doing gwt compiling com.sample.gwt.client.B, it is not considering source path provided in A.gwt.xml and it is giving compilation errors in that.

We have similar build process with Ant, where it is working fine. Same way it is working fine by doing gwt compile from Eclipse.

Can you please suggest what we should do here ?

@tbroyer
Copy link
Owner

tbroyer commented Nov 4, 2020

Run Maven with debug logs (mvn -X) and look for the Classpath: and Arguments: lines.
You could then compare them to what your Ant build is doing, and you can run GWT from the command-line (or your IDE) with this classpath and arguments.

@pratikthaker84
Copy link
Author

pratikthaker84 commented Nov 5, 2020

Hi Thomas,

Thanks for the quick reply. I can see sources.jar file of the project A which contains A.gwt.xml in the Classpath:

I am not seeing anything with Arguments: word.

Also, I have provided below compiler arguments which matches with my Ant build arguments,

				<jvmArgs>-Xmx2048M -Xss1024M -Dgwt.usearchives=false</jvmArgs>
				<localWorkers>6</localWorkers>
				<logLevel>TRACE</logLevel>
				<optimize>9</optimize>
				<compilerArgs>
			            <arg>-XclosureCompiler</arg>
			            <arg>-XnocheckCasts</arg>
			            <arg>-XnoclassMetadata</arg>
			          </compilerArgs>

When I am adding the resource folder of Project A (which contains A.gwt.xml) than it starts doing gwt compile of A.gwt.xml which I do not want.
FYI, I am using GWT 2.7.0

@tbroyer
Copy link
Owner

tbroyer commented Nov 5, 2020

@pratikthaker84
Copy link
Author

Is there any way to stop autodetection of modules and only gwt compile B.gwt.xml ?

@tbroyer
Copy link
Owner

tbroyer commented Nov 5, 2020

There is no auto-detection of modules in this plugin (there is in Mojo's plugin though), gwt:compile will only compile the module configured in <moduleName>.

Oh, BTW, jvmArgs is a list so it should be configured with child elements, same as compilerArgs.

@pratikthaker84
Copy link
Author

pratikthaker84 commented Nov 6, 2020

It was my mistake, by carefully looking into it i found that it was using old plugin.

It has been corrected. The only problem i am facing is in Classpath: or Arguments: i am not seeing resource folder of Project A

I already tried below tags,

<build>
   	<resources>
   		<resource>
                          <directory>${basedir}/src/main/resources</directory>
                        </resource>
                </resources>
          </build>

I can see that the resource folder is there in classpath in Ant build

Any solution to have it available ?

@tbroyer
Copy link
Owner

tbroyer commented Nov 6, 2020

It's expected, because resources have been copied already into target/classes, which is in the classpath.
Resources could be filtered and/relocated, so they're not added directly to the classpath.
If you need to make changes to resources and see them in dev mode, you have to run mvn process-resources to copy them again into target/classes.

@pratikthaker84
Copy link
Author

Do you mean i can add process-resources to existing goal gwt:compile ?

@pratikthaker84
Copy link
Author

Hi Thomas,

Thanks for the suggestions, i am now facing only 1 error mentioned below and I think you can sure help me in that.

Errors in 'jar:file:gwtx/1.5.2/gwtx-1.5.2.jar!/com/googlecode/gwtx/java/util/emul/java/util/regex/Pattern.java'
[INFO]          Line 183: Referencing class 'com.googlecode.gwtx.java.util.emul.java.util.regex.Pattern': unable to resolve class

@tbroyer
Copy link
Owner

tbroyer commented Nov 17, 2020

@tbroyer tbroyer closed this as completed Nov 17, 2020
@tbroyer tbroyer added the question Further information is requested label Nov 17, 2020
@pratikthaker84
Copy link
Author

Thanks for the quick reply.

It is indeed old.

Let's hope it works with 1.5.3. Will let you know

@pratikthaker84
Copy link
Author

It is failing with below error,

[ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:121)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:296)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
[INFO] 	at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
[INFO] 	at com.google.gwt.dev.jjs.ast.JBinaryOperation.traverse(JBinaryOperation.java:83)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
[INFO] 	at com.google.gwt.dev.jjs.ast.JExpressionStatement.traverse(JExpressionStatement.java:42)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
[INFO] 	at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
[INFO] 	at com.google.gwt.dev.jjs.ast.JIfStatement.traverse(JIfStatement.java:53)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
[INFO] 	at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)
[INFO] 	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)
[INFO] 	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038)
[INFO] 	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954)
[INFO] 	at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303)
[INFO] 	at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:286)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[INFO] 	at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[INFO] 	at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO] 	at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[INFO] 	at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO] 	at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO] 	at com.google.gwt.dev.Compiler.main(Compiler.java:127)
[INFO] Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.Annotations$AnnotationChecker
[INFO] 	at com.google.inject.internal.Annotations$AnnotationChecker.<init>(Annotations.java:104)

@pratikthaker84
Copy link
Author

Trying with guice 4.0, i was using 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants