Mofty
Mofty

Reputation: 414

Tycho: How do I deploy sources jars optional?

Based on this i use this code to ship the source of my project.

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-source-plugin</artifactId>
    <version>${tycho.version}</version>
    <executions>
        <execution>
            <id>plugin-source</id>
            <goals>
                <goal>plugin-source</goal>
            </goals>
        </execution>
    </executions>
</plugin>

So far this works fine. I got a xxxx.jar and a xxxx.source.jar

But what if I want to ship the source optional?

Is there a way to make it possible to ship the source only on demand? Like the normal User gets it without source and an other Developer gets it with?

EDIT

after looking into the tycho-soure-feature-plugin this is what i get as result:

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-plugin:1.0.0:source-feature (source-feature) on project projectname.feature: Execution source-feature of goal org.eclipse.tycho.extras:tycho-source-feature-plugin:1.0.0:source-feature failed: An API incompatibility was encountered while executing org.eclipse.tycho.extras:tycho-source-feature-plugin:1.0.0:source-feature: java.lang.UnsupportedClassVersionError: org/eclipse/tycho/packaging/LicenseFeatureHelper : Unsupported major.minor version 52.0

so i looked up why there is an error -> i use JDK 1.6 and on the build server there is no other JDK installed so i cant use this plugin even if i would use Maven Toolchain

Room

Upvotes: 0

Views: 308

Answers (2)

Mofty
Mofty

Reputation: 414

First of all i want to say that the answer form Andreas Sewe is right and i marked it as accepted, because if you use JDK 1.7 this is the best solution.

For my problem (only JDK 1.6 available) I solved it the way to create a new project named xxxx.source

That way i got a separate xxxx.source.jar

Upvotes: 0

Andreas Sewe
Andreas Sewe

Reputation: 1638

Here’s what I would do (and what I think is best practice): Always build the .source.jar of your eclipse-plugins, but offer two eclipse-features: One which includes the source (to be installed by developers) and one which does not (to be installed by normal users). You can use the tycho-source-feature-plugin for this.

Upvotes: 1

Related Questions