I have created a client for my SOAP WebService in Eclipse 4.2.
The project itself (where this client is) was generated by Maven.
Now Eclipse complains about its own generated sources:
"org.apache.axis.constants cannot be resolved to a variable"
"javax.xml.rpc cannot be resolved to a type"
How to make it compile properly?
From what I see the build path doesn't contain all the needed classes, most probably adding these elements to the classpath would solve your problem.
Make sure the referenced projects are in the generated projects build path
Just to add I had the same problem and it was related to Eclipse. I have multiple projects and Eclipse managed incorrectly the classpath when other project is open. I have to close other projects and the classpath defined by pom.xml is properly handled.
Related
Enviroment
I am developing a Maven-Plugin for multimodule build which is using Eclipse Tycho. One of the plugins tasks is a bytecode enhancement and requires the maven projects classpath.
At the moment I am adding all session.getAllProjects() and project.getArtifacts() to the ClassRealm of my PluginDescriptor. This works just fine from the CLI on the parent and child pom.
Problem
If I am trying to build in eclipse (update on one of the projects) maven doesn't resolve the compilepath within the plugin - I only get the plugin classpth (at least in the usecase within eclipse). This leads to an error.
What I've already tried
Using requiresDependencyCollection = ResolutionScope.RUNTIME_PLUS_SYSTEM, requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM in my Mojo Annotation
Getting the classpath from some other variables available
Questions
How is the best way to get the whole maven build classpath in my plugin?
Does the classpath behaviour have anything to do with tycho?
Any post will be appreciated! Thank you very much!
I posted a similar question regarding gradle but this question is without gradle or maven.
I can not get Kotlin working properly using Eclipse IDE. This works great using IntelliJ, however many developers still use Eclipse. I have installed the Kotlin Eclipse plugin and does not work. I have downloaded the Kotlin standard library and runtime library and added them into the project. Still not working. All I get in eclipse when I have Java and Kotlin is cannot be resolve to a specified type.
I'm not using maven or gradle because I couldn't get it working with those two either.
If I mix Java and Kotlin in the same source folder I get this error.
"The type error.NonExistentClass cannot be resolved. It is indirectly referenced from required .class files"
I'm using Eclipse Neon. If anyone can help me that would be awesome, I've been trying for quite some time now and not getting anywhere. :(
Add Kotlin Nature fixes the issue. Click on your project and Configure
Kotlin -> Add Kotlin nature
This partially fixes the issue, though eclipse plugin is still buggy and auto import function still doesn't work for me.
If you're having any issue, make sure you have kotlin_bin folder added in your project. Also make sure that ALL kotlin files have the correct package name sometimes when you rename packages or move files around kotlin classes may not get updated.
Got similar issue solved by adding a new Kotlin file to a Kotlin/Java mixed project. Adding the file caused Eclipse 2018-09 (4.9.0) to add kotlin-stdlib.jar and kotlin-reflect.jar to classpath and everything started working.
Add Kotlin Nature fixes the issue. Click on your project and Configure Kotlin -> Add Kotlin nature
As of the current Eclipse version (2019-09):
You can't add Kotlin to a Java project, but you can add Java to a Kotlin project.
The procedure to accomplish a mixed Kotlin/Java project was roughly:
Install Kotlin plug-in
Create empty Kotlin project
Move the Java code into the Kotlin project
Delete the original project
Fix project references
I'm working on a project with Spring Boot and Kotlin (some controllers/mappers/classes in Java and others in Kotlin) and after trying a lot of approaches, the only that worked was to use Eclipse 03-2020 and Kotlin Plugin for Eclipse V0.8.19.
https://dl.bintray.com/jetbrains/kotlin/eclipse-plugin/0.8.19/
Before everything, close your project and uninstall the previous version of Kotlin Plugin for Eclipse.
Go to Help/Install New Software.
Copy the link of Eclipse Plugin and continue with the installation (do not forget to check all the options to install).
After the installation restart the IDE and try compile again.
If your project was like mine, it has .kt files in /src/main/kotlin, some missing references in Java. I tried compiling them but nothing worked. It turns out that my project didn't have an Eclipse Source Folder associated with the kotlin code. There were the usual ones for "src/main/java", "src/main/resources" but not one for "src/main/kotlin".
So, I created a source folder for the kotlin files.
Right click the project
New "Source Folder"
Specify folder name: "/src/main/kotlin"
This doesn't create anything in the file system but just creates a logical container for Eclipse to work with the contents. In this case, Eclipse recognized the .kt files, compiled them and all the missing references issues all cleared up.
I've recently upgraded from Eclipse Juno to Kepler, and have imported some old projects into a new workspace, but unfortunately I cannot get publishing of one of my web projects to work. It has dependencies on a couple of other projects in the same workspace, and these projects are listed in the 'deployment assembly' tab with entries like
Source Deploy Path
/eventserver WEB-INF/lib
that I have added using the 'Add/Project' option (I'm pretty sure I've previously used 'Add/Entries from Classpath' but that option does not list the projects, so I don't know what's going on). But neither the projects' code nor their dependencies are being deployed to WEB-INF/lib when I publish the main project. Also, I have the following warning showing up:
Description Resource Path Location Type
Projects must be referenced by an EAR or a WAR to use classpath publish/export dependencies whose runtime path (../) maps into the parent component. eventserver P/eventserver Classpath Dependency Validator Message
which I only used to get if I didn't have a main project that referred to the utility project.
Any ideas what's going on?
Create an EAR project using this link:
http://www.eclipse.org/webtools/jst/components/j2ee/scenarios/application_creation_tutorial.html
After creation, try to Add the Project in server entry.
creating a parent project with only a pom.xml, and lots of sub projects such as:
my-web
my-core
my-backoffice
etc. is easy, and the sonotype eclipse plugin does most of the work.
However, getting one project to know about the source in the other project seems to be hard. E.g. when you are debugging the my-web project, and step into my-core, eclipse doesnt know where to get the source.
Looking in the Java Build Path in eclipse, the maven plugin has added my-core as a folder under "Web App Libraries". I.e. its not using the my-core-0.0.1.SNAPSHOT.jar or similar, its using the raw java files. Great!
But how to tell maven to tell eclipse to look for the source in the same place?
Im not really sure where to start. Im guessing its possible to get maven to put the source in a special jar using the maven-soure-plugin, but this will usually be out of sync with the actual java files which the web project seems to be using directly.
A quick and dirty solution is to manually Edit the Java Build Path for each project, and add my-core and other dependant projects in the "Projects" tab. Is this best practice? Any other suggestions?
A quick and dirty solution is to
manually Edit the Java Build Path for
each project, and add my-core and
other dependant projects in the
"Projects" tab.
If this doesn't happen automatically you have a configuration problem.
My Guess would be that you have a version mismatch between the pom dependencies and the actual project versions. Or your projects have an unusual name template (m2eclipse resolves projects by their artifactId AFAIK)
Either way, what always helps is in your Debug configuration (Run > Debug Configurations ...) select the Source tab and just Add... the selected projects.
I'm trying to get a new Enterprise Application Project set up in Eclipse using Glassfish as my app server and I'm seeing the following warning:
Classpath entry eclipse.fproj.jdt.libprov.osgi/jpt.jpa is marked for publish/export but is not exported on the project classpath. Classpath visibility within Eclipse and at runtime will differ.
I've got the Java Persistence 1.0 facet enabled on my EJB project and I'm pretty sure this is what's causing my problems. I've done a lot of searching, but to no avail.
Solved it. I had it marked as a Java EE module dependency, but I didn't have it selected for export. In the project properties window I went to Java Build Path > Order and Export and placed a check next to the entry for EclipseLink 1.1.x.