How to correctly specify eclipse-plugins in category.xml of tycho eclipse-repository? - eclipse

I want to create a p2 repository of some eclipse-plugins during a tycho build.
My category.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="plugins/<artifact-id>-1.0.0.jar"
id="<artifact-id>" version="1.0.0.qualifier">
<category name="cat" />
</feature>
<category-def name="cat" label="example category" />
</site>
where <artifact-id> is the maven artifact id of the eclipse-plugin that shall be included in the p2 repo.
When executing the maven build I get the following error message:
[ERROR] Internal error: java.lang.RuntimeException: "No solution found
because the problem is unsatisfiable.": ["Unable to satisfy dependency
from <repository-module-artifact-id> 1.0.0.qualifier to
<artifact-id>.feature.group[1.0.0,1.0.1).", "No
solution found because the problem is unsatisfiable."]
I have included the eclipse-plugin in the dependencies of the repository-module.
What am I missing here?

as of now you can only reference features in category.xml.
recently there was a patch that will allow referencing individual bundles in a future version of tycho, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=381377

Related

Unbound classpath container: 'JRE System Library [adoptopenjdk-11]' in project '' with Processing

I want to get processing 4 working in VSCode.
https://github.com/processing/processing4
Right not I get several errors that look like:
Unbound classpath container: 'JRE System Library [adoptopenjdk-11]' in project ''
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="adoptopenjdk-11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
It is not a maven or a graddle project, and I prefer to keep it that way if possible (e.g. using a settings.json).
Hope someone can help fix this error.

Custom NuGet package not installing in wix project

I generate a NuGet that is is just a number of redist files that I want to use in one of my projects. If I install it in a C# or C++ projects, it works. But when I try to install it in a wixproj project and I get the following message:
Could not install package 'package-1.0.0'. You are trying to install this package into a project that targets 'Unsupported,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I generate the package through a TeamCity task (using NuGet 5.6.0). When trying to generate the package with a NuGet CLI 5.8.1, I get the following warning:
*WARNING: NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below:
Add a dependency group for native0.0 to the nuspec*
Looked at https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5128, one of the solutions was trying a dependencies group targetFramework, (I used "native0.0") with no success. My nuspec is as follows:
<?xml version="1.0"?>
<package>
<metadata>
<id>package</id>
<version>1.0.0</version>
<authors>package</authors>
<owners>owner</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>my package</description>
<copyright>© 2021 company, Inc</copyright>
<tags>native</tags>
</metadata>
<files>
<file src="downloads\Folder\win32.vs2017\file1.lib" target="lib\native\lib\win32.vs2017\" />
<file src="downloads\Folder\win32.vs2017\file1-debug.lib" target="lib\native\lib\win32.vs2017\" />
<file src="downloads\Folder\Include\**" target="lib\native\include\" />
<file src="build\package.props" target="build\native" />
</files>
</package>
And my props file
<Project>
<PropertyGroup>
<MyVersion>1.0.0</MyVersion>
</PropertyGroup>
</Project>
I can install other NuGet packages into wixprojects, so how I configure mine to work? Thanks.
OK I found it, the issue lies at the line
<file src="build\package.props" target="build\native" />
changing target to "build\" allows the NuGet to be loaded to any project type, included WixProj. Note that the NU5128 warning still exists though, but not an issue for me.

Unresolved dependency error for ivy.xml

I just created a liferay plugin project(Ant plugin) in eclipse IDE and I got this error :
Description Resource Path Location Type unresolved dependency:
com.liferay#com.liferay.ant.arquillian;1.0.0-SNAPSHOT: several
problems occurred while resolving dependency:
com.liferay#com.liferay.ant.arquillian;1.0.0-SNAPSHOT
{test=[default]}: liferay-private: unable to get resource for
com/liferay#com.liferay.ant.arquillian;1.0.0-SNAPSHOT:
res=${ivy.repository.liferay.private.url}/com/liferay/com.liferay.ant.arquillian/1.0.0-SNAPSHOT/com.liferay.ant.arquillian-1.0.0-SNAPSHOT-javadoc.jar:
java.net.MalformedURLException: no protocol:
${ivy.repository.liferay.private.url}/com/liferay/com.liferay.ant.arquillian/1.0.0-SNAPSHOT/com.liferay.ant.arquillian-1.0.0-SNAPSHOT-javadoc.jar
liferay-private: unable to get resource for
com/liferay#com.liferay.ant.arquillian;1.0.0-SNAPSHOT:
res=${ivy.repository.liferay.private.url}/com/liferay/com.liferay.ant.arquillian/1.0.0-SNAPSHOT/com.liferay.ant.arquillian-1.0.0-SNAPSHOT.pom:
java.net.MalformedURLException: no protocol:
${ivy.repository.liferay.private.url}/com/liferay/com.liferay.ant.arquillian/1.0.0-SNAPSHOT/com.liferay.ant.arquillian-1.0.0-SNAPSHOT.pom ivy.xml /MyFirstPortlet-portlet Unknown IvyDE
Problem
It seems my ivy file cant resolve dependencies. My ivy.xml file is here
I checked http://ant.apache.org/ivy/maven link in ivy.xml and found out that it doesn't exist. I think that's the problem. If it is how can I correct my ivy.xml file?
just change ivy.xml as following;
<?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="test-portlet" organisation="com.liferay">
<extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>
<dependencies defaultconf="default">
<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0" />
</dependencies>
</ivy-module>

Prevent IvyDE from resolving specific build time dependencies

Its maybe that I'm trying to misuse Ivy, but if I am then I definitely don't understand 'configurations'
I have a dependency I want to access only when running my build script under Jenkins. In my eclipse workspace I have no need for the dependency. Is it possible to achieve this?
For example if I wanted to pull ant-contrib in at build time I have tried setting up my configuration file as follows:
<configurations defaultconf="compile">
<conf name="compile" visibility="public" />
<conf name="build" visibility="public" extends="compile" />
</configurations>
<dependencies>
<dependency org="junit" name="junit" rev="4.8.1" conf="compile->default" />
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="build->*" />
</dependencies>
With this example I always end up with ant contrib and ant on my build path in eclipse which isn't what I wanted. The resolve ant task allows me to resolve a specific configuration so I assumed that IvyDE would only resolve the default one. What am I missing?
Thanks,
Dan.
When adding the ivy file using IvyDE it is possible to select the configurations that should be resolved. This way only compile can be selected and only junit would be resolved.
It seems that to change this you need to remove and re-add the ivy dependency, I can't find any settings to change the configurations without doing that.

Eclipse Ivy plugin says jruby has an unresolved dependency, but jruby 1.6.6 doesn't have any

I'm getting this error when I try to add jruby as a dependency using the ivy Eclipse plugin:
Impossible to resolve dependencies of com.restphone#;working#James-Moores-iMac.local
unresolved dependency: org.jruby.extras#bytelist;1.0.8: not found
This is in my ivy.xml:
<dependency org="org.jruby"
name="jruby-complete"
rev="1.6.6" />
And this is in ivysettings.xml:
<ivysettings>
<settings defaultResolver="chain"/>
<resolvers>
<chain name="chain">
<ibiblio name="codehaus" m2compatible="true" root="http://repository.codehaus.org/"/>
</chain>
</resolvers>
</ivysettings>
But according to the jruby mailing list, jruby has NO dependencies for runtime, compile or
test scope.
Do I need to give the ivy plugin more information somewhere?
In my opinion it's always a good idea to specify a configuration mapping for your dependencies.
The following ivy file worked fine for me. As described, only the ruby jar was downloaded.
<ivy-module version="2.0">
<info organisation="org.demo" module="demo"/>
<configurations>
<conf name="compile"/>
<conf name="runtime" extends="compile"/>
<conf name="test" extends="runtime"/>
</configurations>
<dependencies>
<dependency org="org.jruby" name="jruby-complete" rev="1.6.6" conf="compile->default"/>
</dependencies>
</ivy-module>
Here I have mapped my local "compile" configuration to the default remote configuration. (In a Maven module, the default ivy configuration translates to the "compile" scope).
I dug into the remote POM file:
<properties>
<jar.scope>provided</jar.scope>
..
..
<dependency>
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<scope>${jar.scope}</scope>
</dependency>
<dependency>
<groupId>org.jruby.extras</groupId>
<artifactId>jnr-netdb</artifactId>
<scope>${jar.scope}</scope>
</dependency>
...
All the extra depedencies have been declared in the "provided" Maven scope.
Couple of issues:
1)
In Maven the provided scope is used for jars which are required for compiling that module. They do not need to be packaged because they are part of the target runtime environment. Similarily such dependencies are not needed as transitive dependencies for your module and hence don't need to downloaded.
2)
All the jars are all located in the Maven Central repository. The following settings file would retrieve everything, if you chose to omit the ivy configuration mapping
<ivysettings>
<property name="ivy.checksums" value=""/>
<settings defaultResolver="chain"/>
<resolvers>
<chain name="chain">
<ibiblio name="central" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
3)
The following error is caused by a junk checksum. My provided settings file disables this check... something you are advised not to do on a remote repository
[ivy:resolve] :::: WARNINGS
[ivy:resolve] problem while downloading module descriptor: http://repo1.maven.org/maven2/org/jruby/extras/bytelist/1.0.8/bytelist-1.0.8.pom: invalid sha1: expected=e40ee094403473e43f71e21cf9cbf71f08d2098b computed=a9627bc7e42f886e290985367040794adb676320 (977ms)
[ivy:resolve] module not found: org.jruby.extras#bytelist;1.0.8
Although the JRuby docs may not state a required dependency, it looks as though the repository that you are using does...
You've asked for 'jruby-complete' and if you go and look at this POM you will see its specifying the jruby extras.
One option is to select a different POM file as the basis of your dependency, but a quick fix is to add the attribute transitive="false" to your dependency.
<dependency org="org.jruby"
name="jruby-complete"
transitive="false"
rev="1.6.6" />