OS: Windows 7 x64
Eclipse Platform: 3.7.2.M20120208
m2e: 1.0.200.20111228-1245
Have similar problem as in this bug. There is a bunch of package-info.java
files in /src
and /test
folders, so they have same package. Eclipse show error:
"The type **package-info** is already defined"
I can delete package-info.java
files either in /test
or /src
to avoid problem indication. But this workaround is not very comfort since I am using SCM and need to delete this files all time after update. Same for Eclipse Platform 4.2.0.I20120608-1400
package-info. java is a way to apply java annotations at the package level. In this case Jaxb is using package-level annotations to indicate the namespace, and to specify namespace qualification for attributes (source). Follow this answer to receive notifications.
The package-info. java is a Java file that can be added to any Java source package. Its purpose is to provide a home for package level documentation and package level annotations.
In IntelliJ IDEA, we can right-click on the package and select New-> package-info. java: Eclipse's New Java Package option allows us to generate a package-info.
You can do this -->
Go to Build path -> configure build path -->
in Source tab -->
select the package (in which you have these problematic package-info.java file) for eg. project-name/src/test/java
click on exclude -> and in exclusion pattern add "**/package-info.java"
this should solve the problem, as plainly you are asking eclipse to exclude these files, and thus you wouldn't have to delete those files and solving your SCM related issues
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With