1

Since a very long time I'm using STS (eclipse) to code on jenkins and jenkins-plugins.

But since I upgraded to the latest version (STS 3.8.1) I'm not able to do so anymore... The reason is an error I get when ever I import a jenkins-plugin project (maven based, e.g. https://github.com/jenkinsci/config-file-provider-plugin/):

Only a type can be imported. com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl resolves to a package

While the message is true about the fact that there is a package called the same as a class, this is the case for many many classes in the source of Jenkins. This is actually a convention, all resources belonging to a specific class have to be places in a package with the same name as the class.

Is there anything I can do to ignore this error?

domi
  • 2,167
  • 1
  • 28
  • 45
  • Does the class exist and is it public? Maybe problem with different jars- then a classpath change, dependency reordering might help. – Joop Eggen Aug 09 '16 at 18:03
  • Related: http://stackoverflow.com/questions/9584086/java-class-name-same-as-the-nested-package-name – John Bollinger Aug 09 '16 at 18:09
  • It looks like your compiler is buggy. I can't speak to whether there is a way to intimidate it into not being buggy, but if you're community-minded then you might consider filing a bug report. Meanwhile, consider downgrading to a version that does not exhibit this bug. – John Bollinger Aug 09 '16 at 18:20
  • @JoopEggen the classes do exist and they are public – domi Aug 09 '16 at 18:32
  • @JohnBollinger created an issue for STS https://issuetracker.springsource.com/browse/STS-4392 – domi Aug 10 '16 at 05:31

1 Answers1

4

its a bug in eclipse and hopefully fixed soon: https://bugs.eclipse.org/bugs/show_bug.cgi?id=495598

domi
  • 2,167
  • 1
  • 28
  • 45