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

Ignore "The type XXX is already defined." message for JEP 247 #596

Closed
RussiaVk opened this issue Dec 7, 2022 · 3 comments
Closed

Ignore "The type XXX is already defined." message for JEP 247 #596

RussiaVk opened this issue Dec 7, 2022 · 3 comments

Comments

@RussiaVk
Copy link

RussiaVk commented Dec 7, 2022

I'm using maven-compiler-plugin to make my project support run on different jdk version (JEP 247).

	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-compiler-plugin</artifactId>
		<executions>
                    <execution>
                        <id>compile-java-8</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                        	<compilerVersion>1.8</compilerVersion>
                            <source>1.8</source>
                            <target>1.8</target>
                            <compileSourceRoots> <compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot>
                            </compileSourceRoots> 
                        </configuration>
                    </execution>
                    <execution>
                        <id>compile-java-14</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration> 
                            <release>14</release> 
                            <compileSourceRoots> <compileSourceRoot>${project.basedir}/src/main/java14</compileSourceRoot>
                            </compileSourceRoots>
                            <outputDirectory>${project.build.outputDirectory}/META-INF/versions/14</outputDirectory>
                        </configuration>
                    </execution> 
                </executions>
	</plugin>

And I added different of compileSourceRoots into classpath.
But eclipse error:
image

The type XXX is already defined.
I hope eclipse can ignore this error message.

@Marcono1234
Copy link

Seems to be related to #265

@stephan-herrmann
Copy link
Contributor

Seems to be related to #265

Right, the request seems to be related to JEP 238, not JEP 247.

@stephan-herrmann
Copy link
Contributor

The type XXX is already defined.
I hope eclipse can ignore this error message.

Ignoring that error is not a good idea, as it would be totally unclear which of the duplicates should be used for the rest of the build. Let's continue in #265 - closing this one.

@stephan-herrmann stephan-herrmann closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
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