Missing artifacts on Maven Central Repository - eclipse

Maven central repository does not have jars and artifacts of Eclipse Juno 4.2 release.
Where can i find all these jars and artifacts(along with pom.xml-including transitive dependencies).It will be helpful for us to resolve all maven dependencies as we are planning to migrate eclipse plugins from 3.2 to 4.2.

Before posting a new question, take a look to the old ones.
I think this thread will reply to your : Maven with Eclipse Juno

We faced a similar Problem. Perhaps you should consider using Tycho to build Eclipse Plugins with Maven. It supports using eclipse update sites as dependency source. This way you do not need to resolve eclipse dependencies from a Maven repository.
Tycho takes the Manifest file as dependency definition. However it is still possible to include maven dependencies. The concrete plugin project has to have the packaging
<packaging>eclipse-plugin</packaging>
If your target platform definition does not contain the needed update sites that contain your dependencies add this to your pom:
<repositories>
<repository>
<id>indigo</id>
<!-- Or juno update site in your case -->
<url>http://download.eclipse.org/releases/indigo/</url>
<layout>p2</layout>
</repository>
</repositories>
Additionally you have to configure the build as following:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<!-- coordinates of your target platform definition -->
</artifact>
</target>
<!-- This allows you to additionally consider pom dependencies -->
<pomDependencies>consider</pomDependencies>
<configuration>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</configuration>
</plugin>
</plugins>

Related

Why Tycho cannot resolve this simple dependency to SWT?

I thought to have studied enough Maven + Tycho to configure at least a minimal target environment for a headless build, but still I am unable to make this small example work. I have three projects:
test, that contains
sub.ui and
sub.target
The test project has just a pom.xml that builds the two subprojects and whose only interesting part is the <pluginManagement> section:
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>target-platform</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<pomDependencies>wrapAsBundle</pomDependencies>
<target>
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>sub.target</artifactId>
<version>0.0.1-SNAPSHOT</version>
</artifact>
</target>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
verbose but quite straightforward (except perhaps for the lifecycle-mapping plugin, that however impacts only when building under Eclipse, and I want to build outside Eclipse). The sub.target project has a canonical pom.xml with just:
...
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
</plugin>
</plugins>
</build>
...
and a brief sub.target.target file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target includeMode="feature" name="Test" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/latest/"/>
<unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="0.0.0"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
</target>
The sub.ui project is a small plugin project with a silly main that uses a SWT class:
package foo;
import org.eclipse.swt.widgets.Label;
public class Main {
public static void main(String[] args) {
Label l = new Label(null, 0);
}
}
and a MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test UI
Bundle-SymbolicName: sub.ui;singleton:=true
Bundle-Version: 0.0.1.qualifier
Automatic-Module-Name: sub.ui
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.swt
Now, if I open a console and I mvn clear compile, Maven fails while building the Test UI plugin, and displays the errors:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.4.0:compile (default-compile) on project sub.ui: Compilation failure: Compilation failure:
[ERROR] /.../sub.ui/src/foo/Main.java:[3]
[ERROR] import org.eclipse.swt.widgets.Label;
[ERROR] ^^^^^^^^^^^
[ERROR] The import org.eclipse cannot be resolved
[ERROR] /.../sub.ui/src/foo/Main.java:[8]
[ERROR] Label l = new Label(null, 0);
[ERROR] ^^^^^
[ERROR] Label cannot be resolved to a type
[ERROR] /.../sub.ui/src/foo/Main.java:[8]
[ERROR] Label l = new Label(null, 0);
[ERROR] ^^^^^
[ERROR] Label cannot be resolved to a type
[ERROR] 3 problems (3 errors)
Apparently the build process does not link my code with the SWT version for my macos+cocoa platform, that is nevertheless listed among the plugins in the org.eclipse.equinox.p2.user.ui.feature.group. Strangely, if I launch Maven from Eclipse every now and then it links the right SWT library and completes the build process. What am I missing? How do I convince Tycho to use the information about my platform to consistently select the macos+cocoa SWT jar and link it to my code? I can share the complete example project on GitHub upon request if you cannot spot the mistake in the above code. Thank you for your patience.
Problem solved. Apparently the x86 platforms are no longer supported (the project I am working on is quite old). If we remove all the x86 <environment>s from the <pluginManagement> section of the main pom.xml file and leave only the x86_64 ones, everything works.

How to build a multiplatform Eclipse update site with Tycho

On my PDE/Tycho Eclipse environment I want to build a plugin of type eclipse-repository which contains 3 features each one for a specific platform.
The eclipse-repository plugin reads all its configuration from a parent plugin which content is the following:
<properties>
<tycho.version>0.26.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>neon</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/neon/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to build the eclpse-repository project I get an error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:0.26.0:assemble-repository (default-assemble-repository) on project ... : Execution default-assemble-repository of goal org.eclipse.tycho:tycho-p2-repository-plugin:0.26.0:assemble-repository failed: Cannot resolve dependencies of MavenProject ...

Build single update-site for RAP and RCP flavored feature

I have a build for a single-sourced RCP/RAP Eclipse feature project that uses maven profiles to either build RAP or RCP bundles, fragments and features.
This works reasonably well. If I include my update site project as module in the above build's parent POM I can also easily build a platform-specific update-site using either "eclipse-update-site" (or "eclipse-repository") packaging.
However, I was wondering, if there is a way to
build RCP target platform > publish to local repo
build RAP target platform > publish to local repo
run build for RCP (target platform from step 1) > publish to local repo
run build for RAP (target platform from step 2) > publish to local repo
run build for update site only, include feature for RAP and for RCP (not compiling anything, just assembling from 1+2)
I could successfully execute steps 1-4, but not 5, because Tycho was trying to resolve the features referenced by the category.xml with a different qualifier.
If I understand update sites/p2 repositories correctly, it should be possible to offer any artifacts / bundles / features in various flavors, right?
How can I solve this, or rather: can I have a single tycho build that runs the above build steps consecutively with the same qualifier for all?
Addendum: This existing question goes in the same direction and suggests to "install the (feature) Tycho project(s) into ... local Maven repository". That's actually what I'm doing when I run 1. and 2. after each other, specifiying the same local repo for both. But then 3. fails to pull the referenced artifacts from there, because the qualifier is different (two distinct reactor builds). Running everything in the same reactor build would be totally fine for me, but I think that's not possible, because there are different target platforms involved.
I think the solution there is pretty close to what I need, but I don't understand how my category.xml (or site.xml) and the extra dependencies in POM work together. Do I have to abandon category.xml altogether and respecify all my dependencies in the eclipse-repository POM?
My build roughly looks like this:
foo.releng/pom.xml (parent POM)
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>net.bar</groupId>
<artifactId>foo</artifactId>
<version>0.31.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho-version>1.0.0</tycho-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco-version>0.7.6.201602180812</jacoco-version>
</properties>
<modules>
<module>../foo.plugin1</module>
<module>../foo.plugin2</module>
<!-- feature module is built depending on target platform, see below -->
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<!-- target and dependency-resolution are RAP/RCP dependent, see profiles below -->
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>target-rcp</id>
<activation>
<property>
<name>target.platform</name>
<value>rcp</value>
</property>
</activation>
<modules>
<module>../foo.fragment.rcp</module>
<module>../foo.feature.rcp</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>net.bar</groupId>
<artifactId>net.bar.foo.target.rcp</artifactId>
<version>${project.version}</version>
<classifier>rcp</classifier>
</artifact>
</target>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.ui</id>
<versionRange>0.0.0</versionRange>
</requirement>
... more rcp-only dependencies
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>target-rap</id>
<activation>
<property>
<name>target.platform</name>
<value>rap</value>
</property>
</activation>
<modules>
<module>../foo.fragment.rap</module>
<module>../foo.feature.rap</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
... same as for RCP above, but for RAP
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
An this is the updatesite/category.xml
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/net.bar.foo.feature.rcp_0.31.0.qualifier.jar" id="net.bar.foo.feature.rcp" version="0.31.0.qualifier">
<category name="net.bar.rcp"/>
</feature>
<feature url="features/net.bar.foo.feature.rap_0.31.0.qualifier.jar" id="net.bar.foo.feature.rap" version="0.31.0.qualifier">
<category name="net.bar.rap"/>
</feature>
<category-def name="net.bar.rcp" label="RCP">
<description>
RCP Platform Features
</description>
</category-def>
<category-def name="net.bar.rap" label="RAP">
<description>
RAP Platform Features
</description>
</category-def>
</site>
And the updatesite/pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<version>0.31.0-SNAPSHOT</version>
<relativePath>../foo.releng/pom.xml</relativePath>
<artifactId>foo</artifactId>
<groupId>net.bar</groupId>
</parent>
<artifactId>net.bar.foo.updatesite</artifactId>
<packaging>eclipse-repository</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<archiveSite>true</archiveSite>
</configuration>
</plugin>
</plugins>
</build>
</project>
This question which concerns a very similar problem helped me to find a solution.
I succeded by configuring the tycho-packaging-plugin with a reproducible timestamp qualifier.
By using a constant version qualifier (based on the git commit ID) for all of my consecutive builds, the final repository build could resolve all referenced feature bundles correctly in the local maven repo.
After this adjustment the following build runs through without any problems and publishes a RAP and RCP feature flavor:
# build rcp target
cd foo/net.bar.foo.target.rcp
mvn clean install -Dmaven.repo.local=../../m2
# build rap target
cd ../net.bar.foo.target.rap
mvn clean install -Dmaven.repo.local=../../m2
# build features and plugins for rcp, then for rap
cd ../net.bar.foo.releng
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rcp
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rap
# build p2 repository
cd ../net.bar.foo.updatesite
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rap
VoilĂ :

Eclipse cannot find dependencies of a plugin built with Maven Tycho

I am using Maven Tycho to compile my projects which are structured like this :
- plugin1
- plugin2 (depends on plugin1)
- plugin3 (depends on plugin1 & 2)
- plugin4 (depends on plugin1)
- plugin5 (depends on plugin1 & 4)
- plugin6 (depends on all previous plugins)
- plugin7 (depends on all previous plugins)
{all these plugins are compiled as eclipse-plugin}
- feature1 (contains all previous plugins) {eclipse-feature}
- updatesite1 {eclipse-repository}
- generalproject (contains only the parent pom)
I compile this via Eclipse (maven install), everything works and i can access my local repository, and install my feature in the same Eclipse (through "Install new software").
The problem is when i try to install my feature to another instance of Eclipse, which refuse to install it with the error :
(Missing requirement: Acceleo Texts Module IDE Plug-in 1.0.0.201612161812 (myproject.acceleo.ui 1.0.0.201612161812) requires 'bundle org.eclipse.ocl 0.0.0' but it could not be found)
I know that this is a non satisfied requirement problem, but in Eclipse i checked "Contact all update sites during install to find required software", and my pom declares repositories containing all requirements, here is my parent pom :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myproject.project</groupId>
<artifactId>myproject.general</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho.version>0.23.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/mars/</url>
</repository>
<repository>
<id>Sirius</id>
<layout>p2</layout>
<url>http://download.eclipse.org/sirius/updates/releases/4.1.2/mars/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<!-- enable tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<!-- enable tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>i386</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>../myproject</module>
<module>../myproject.acceleo</module>
<module>../myproject.acceleo.ui</module>
<module>../myproject.design</module>
<module>../myproject.edit</module>
<module>../myproject.editor</module>
<module>../myproject.plugin</module>
<module>../myproject.project</module>
<module>../myproject.site</module>
</modules>
</project>
I cannot figure how to resolve this ? did i omit something in my procedure ?
Thank you.
I fell for the same thing. Tycho does not include all dependencies, even though that's normal and desired maven behaviour. As maven does not "see" tycho (so manifest-derived) dependencies, they are not included.
You can override this behaviour by setting to true:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</plugin>
Probably the Eclipse installation where you want to install your feature does not have an update site configured that contains org.eclipse.ocl. This has nothing to do with your Maven build, as long as you didn't configure your feature to also contain the required bundles, which could also be done.

How to build Eclipse RCP only for specific OS

I have set up an Eclipse RCP build with maven and tycho. Currently there are build results for several OS's that I don't need. How can I restrict It only to be build for a speciffic OS?
I don't know much about tycho, however I know there is a separate plugin to configure the platforms.
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
I did find a few links in Google as well. Googling "tycho target platform" will probably find you more.
[http://www.vogella.com/articles/EclipseTycho/article.html]
[http://wiki.eclipse.org/Tycho/Plugins_Explained#target-platform-configuration]