This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258734 - Netbeans can't see target classes
Summary: Netbeans can't see target classes
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-08 18:23 UTC by cy6ergn0m
Modified: 2016-10-13 08:05 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Example project (3.00 KB, application/zip)
2016-04-12 16:26 UTC, cy6ergn0m
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cy6ergn0m 2016-04-08 18:23:04 UTC
I have a maven project. There are two compilers in it: java and kotlin (kotlin is a language that can generate JVM bytecode). Kotlin starts first and then javac. 

If I run from command line then everything works perfect. If I use Netbeans "test project" then NetBeans launches Maven to compile and test and everything is fine.

However NetBeans won't see java classes produced by Kotlin (in target/classes dir). If I try "test file" or "run file" then Netbeans doesn't run maven compile but compiles the file itself and generates code that throws "Runtime exception: Uncompilable source code".

It's ok that NetBeans doesn't support kotlin source files but I believe it should be able to see classes generated by maven.
Comment 1 Tomas Stupka 2016-04-12 14:42:13 UTC
any change to provide a simple sample project to reproduce?

thanks
Comment 2 cy6ergn0m 2016-04-12 16:26:59 UTC
Created attachment 159235 [details]
Example project
Comment 3 cy6ergn0m 2016-04-12 16:29:26 UTC
Once you disable "Compile On Save" feature the exception on run should disappear but Java code is still run even if there are class files in the target directory
Comment 4 cy6ergn0m 2016-04-12 16:32:24 UTC
oops, typo

... but Java code is still red even if there are class files in the target directory
Comment 5 Tomas Stupka 2016-06-30 14:56:33 UTC
WAD. Even though it might sound counterintuitive, generaly speaking has the IDEs intern compilation good reasons not to look on the classes in build output and to prefer the sources instead. This, obviouslly and unfortunatelly, doesn't work so well in scenarios like Kotlin. 

will keep this open as a request for some Kotlin support

not sure how the kotlin-maven-plugin works, but a possible workaround could be to pack the kotlin generated classes in a repository artifact and then depending on it ...
Comment 6 Tomas Stupka 2016-10-13 08:05:33 UTC
seems to work with the kotlin-netbeans plugin
closing