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

-Werror flag not recognized by groovy-eclipse-compiler #254

Closed
moormanm opened this issue Jan 8, 2017 · 3 comments
Closed

-Werror flag not recognized by groovy-eclipse-compiler #254

moormanm opened this issue Jan 8, 2017 · 3 comments

Comments

@moormanm
Copy link

moormanm commented Jan 8, 2017

When using the following maven configuration:

		<plugin>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.3</version>
			<configuration>
				<compilerId>groovy-eclipse-compiler</compilerId>
				<fork>false</fork>
				<source>1.8</source>
				<target>1.8</target>
				<showWarnings>true</showWarnings>
				<compilerArgs>
					<arg>-Xlint:all</arg>
					<arg>-Werror</arg>
				</compilerArgs>
			</configuration>
			<dependencies>
				<dependency>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy-eclipse-compiler</artifactId>
					<version>2.9.2-01</version>
				</dependency>
				<dependency>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy-eclipse-batch</artifactId>
					<version>2.4.3-01</version>
				</dependency>
			</dependencies>
		</plugin>

Results in:

[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ DocumentMapper ---
[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Unrecognized option : -Werror

[INFO] Found 0 errors and 0 warnings.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.559s

@eric-milles
Copy link
Member

I think you need to use <arg>-F-Werror</arg>

http://groovy-lang.org/groovyc.html

@moormanm
Copy link
Author

Thanks for the response Eric.

I tried using -F-Werror in the pom, but it seems that option is not recognized:

<plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <compilerId>groovy-eclipse-compiler</compilerId> <fork>false</fork> <source>1.8</source> <target>1.8</target> <showWarnings>true</showWarnings> <compilerArgs> <arg>-Xlint:all</arg> <arg>-F-Werror</arg> </compilerArgs> </configuration> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-compiler</artifactId> <version>2.9.2-01</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-batch</artifactId> <version>2.4.3-01</version> </dependency> </dependencies> </plugin>

[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Unrecognized option : -F-Werror

@moormanm
Copy link
Author

I looked at the source code GroovyEclipseCompiler and saw some hints about some supported flags. This one seems to work, but it requires that I specifically call out the warnings I'm interested in seeing.

-err:+deprecation,fallthrough,finally,over-ann,raw,unchecked,suppress,unusedImport,unusedLocal

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

2 participants