Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Compiling multiple source folders with Tycho

As mentioned on stack overflow: Your goal is simply not clear so no one can tell if it is possible or not. I'm able to use plugins from a parent pom without a problem in a pure pomless-build...

Am 25.09.20 um 14:54 schrieb S. John:
Thank you, Jörg.

I already assumed that controlling the plugins specified in the parent pom would not be possible following a pure pom-less build.

For the pluginManagement solution you mentioned to use it within a profile. I never used Maven profiles (intentionally), yet, but I had a look at them now. I am not sure I get that correctly. In my understanding I would still have to specify the respective plugins I want to use in the POMs of the modules (without the need to configure them there, as this can be done in the parent). So I guess the only difference between using pluginManagement within a profile-environment instead of directly within the build-environment of the parent is that you get even more flexibility?

Your hint about checking for existence of empty files is a nice-to-know trick. I'll keep that in mind.

Maybe you want to formulate an answer on stackoverflow so I can accept it. If you do, it would probably be good to mention clearly that my goal cannot be reached with a pure pom-less setup if you feel confident about that fact.

Best regards,
Stefan


On 25.09.2020 08:41, Jörg Schaible wrote:

Hi Stefan,


this is what I meant with "exceptional stuff". For those cases I have a pom.xml. You will have to set the proper values for the G:A:V, but you don't have to repeat the dependencies declared in the manifest. You can add additional deps though, that won't be part of the classpath, e.g. we use it to copy a ZIP with files containing the generated eclipse help.


However, if you have in some modules a task that could be shared (e.g. the xtend plugin or the maven-dependencies-plugin extracting dependencies basen on a specific type or classifier) you may configure this in the parent using a pluginManagement section of a profile.


If you activate the profile based on the existence of a file (e.g. "profiles/copy-deps") you may simply create such an empty file in your module and the profile is active. This is a commonly used technique for Maven (independent of Tycho).


Regards,

Jörg



Am Donnerstag, 24. September 2020, 18:54:04 CEST schrieb S. John:

Thanks, Jörg.

Actually, I started with a pom-less configuration (and also looked at Lars Vogels tutorial).
I also posted a question concerning pom-less builds on stackoverflow:

https://stackoverflow.com/questions/64030043/tycho-pomless-configure-prevent-plugin-execution-for-individual-modules-pa

I guess, it's quite likely that one of the users on this list can answer it. Maybe have a look.

Best regards,
Stefan

On 24.09.2020 11:33, Jörg Schaible wrote:

Hi Stefan,

while you're learning and still and consolidating your setup, you should also have a look at pom-less builds:

http://blog.vogella.com/2019/11/25/pom-less-tycho-enhanced/

This is an Maven/Tycho extension based on Polyglot (a Maven extension to read and write POM files in other notations that XML) that uses the manifest and .classpath files directly for the required info to build. This is quite natural with Eclipse and you will use ordinary pom.xml files only for exceptional stuff, like generating some additional resources, etc.

Regards.

Jörg

Am Donnerstag, 24. September 2020, 11:22:48 CEST schrieb S. John:

Thank you for that information! Playing around with the .classpath made me aware of an interplay of mistakes of mine which went unnoticed. Everything works fine now. One question remains, however. I expected the .classpath to only be relevant for the Eclipse Java Builder. And actually Tycho doesn't seem to be very interested in src-Folders or containers defined there. What kind of information from the .classpath is relevant for Tycho?

The following TL;DR part is merely meant to help other people to not fall into the same pits as I did. My mistakes:

First, I tried to keep in mind that from the Maven viewpoint "there is no Eclipse" as mentioned in a very early article by Peter H. Petersen and Sumit Gupta (https://www.eclipse.org/articles/Article-Eclipse-and-Maven2//). As such, while experimenting with Tycho, I made some changes to the project without giving attention to a working Eclipse build. E.g., I added the additionalsources/testpackage without even putting it on the build path as I didn't expect Maven to even look at the .classpath. Unfortunately, by mistake I copy&pasted some Java file into that folder without adapting the package statement. In consequence, the Java file was indeed compiled by Tycho but to a folder I didn't expect it in. Actually, probably naively, I expected Maven to decide by the source folder structure where to put the sources.

Second, I didn't keep in mind that I had once configured the Maven nature for the project. That, occasionally, led to Eclipse overwriting the target folder without me noticing it. As you can imagine that made me go crazy about the observations I made when changing something.

Best regards,
Stefan

On 23.09.2020 19:01, Christian Dietrich wrote:

.classpath + build.properties + packaging eclipse-plugin in pom should be sufficient

Am 23.09.20 um 18:47 schrieb S. John:

Hi everybody,

I am new to Tycho (and not so experienced with Maven, either) and try to switch to an Eclipse independent Maven build for an existing plugin project. However, I don't seem to be able to succeed in compiling multiple source folders with Tycho. Is there anything else, apart from the |build.properties| of an Eclipse plugin, which Tycho considers when searching for source folders? So far, I have the following |build.properties|:

|bin.includes = .,\||
||               META-INF/,\||
||               plugin.xml,\||
||               plugin.properties,\||
||               models/||
||jars.compile.order = .||
||source.. = src/main/java/,\||
||           src/additionalsources/||
||output.. = bin/|

As the name suggests,|src/additionsources/| contains a folder |testpackage| with a simple Java file in it. However, |mvn clean compile| only compiles the sources in |src/main/java| and puts them into |target/classes|.

As Tycho needs to use it's own compiler MOJO, I assume |build-helper-maven-plugin| will not help me in any way. Neither will |maven-compiler-plugin| be of any use, right?

There is a related thread on the old forum which did not help me, unfortunately: https://www.eclipse.org/forums/index.php?t=msg&th=206776&goto=661914&#msg_661914. Is there anything I might have missed?

Best regards,
Stefan

_______________________________________________

tycho-user mailing list

tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________

tycho-user mailing list

tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user


_______________________________________________

tycho-user mailing list

tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visithttps://www.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tycho-user



Back to the top