Bug 510338 - Different source folder for maven vs. PDE build
Summary: Different source folder for maven vs. PDE build
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-12 03:59 EST by rgra Missing name CLA
Modified: 2021-04-28 16:53 EDT (History)
1 user (show)

See Also:


Attachments
Example Project (1.24 MB, application/octet-stream)
2017-01-12 05:28 EST, rgra Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rgra Missing name CLA 2017-01-12 03:59:18 EST
According to:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=368083
it was once possible to configure a different source directory for the maven build than the one used in the PDE build.

For me this is a necessary requirement to allow building my projects which use Lombok with Tycho  Using Lombok directly with Tycho causes some configuration problems and I didn't get a stable build.

Thus I have to use the Delombok Plugin first to produce plain Java source which the Tycho build has to pick up. Delombok uses the sources from 'src' and outputs a new 'generated' folder.

The default Tycho always uses the PDE configured build directories and AFAIK doesn't allow to override the standard source folder any more. I can only add additional sources.

Currently I use a Tycho version I build myself which replaces 'src' with 'generated' and the builds work fine. But this is not the final solution I'm looking for.
Comment 1 Jan Sievers CLA 2017-01-12 04:09:41 EST
>The default Tycho always uses the PDE configured build directories and AFAIK 
>doesn't allow to override the standard source folder any more. I can only add 
>additional sources.

you can configure whatever source folders you want in build.properties e.g.

source..=generated/

there is no such thing as a default source folder

if this does not solve your problem, we would need a small sample project that demonstrates the problem along with steps to reproduce and observed vs. desired behaviour
Comment 2 rgra Missing name CLA 2017-01-12 05:28:22 EST
Created attachment 266263 [details]
Example Project

Hello Jan,

thanks for your fast reply.

Indeed I was missing a fact: I don't need the delombok workaround in eclipse, so there I'm using the default 'src' directory and everything works fine. If I change it to 'generated' it won't work in eclipse.

My example might be very Lombok centric but like mentioned in the other bug, other instrumentation and code generation plugins might need this as well.

I prepared an example project for you. To get it working in eclipse you would need to install lombok, see:
https://projectlombok.org

The maven build with Tycho 0.26 fails because it can't handle the Lombok annotations:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.26.0:compile (default-compile) on project de.rgra.tycho.lombok.example: Compilation fai
lure: Compilation failure:
[ERROR] D:\workspaces\tycho\de.rgra.tycho.lombok.example\src\de\rgra\tycho\lombok\example\LombokDataExample.java:[19]
[ERROR] private final String name;
[ERROR] ^^^^
[ERROR] The blank final field name may not have been initialized
[ERROR] D:\workspaces\tycho\de.rgra.tycho.lombok.example\src\de\rgra\tycho\lombok\example\LombokDataExample.java:[22]
[ERROR] LombokDataExample lombokDataExample = new LombokDataExample("Test");
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The constructor LombokDataExample(String) is undefined
[ERROR] D:\workspaces\tycho\de.rgra.tycho.lombok.example\src\de\rgra\tycho\lombok\example\LombokDataExample.java:[23]
[ERROR] System.out.println(lombokDataExample.getName());
[ERROR] ^^^^^^^
[ERROR] The method getName() is undefined for the type LombokDataExample
[ERROR] 3 problems (3 errors)

For the normal Maven Java Compiler there is support for Lombok with the Lombok Maven Plugin:
https://projectlombok.org/mavenrepo/
Comment 3 Mickael Istria CLA 2021-04-08 18:04:40 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.