ikvmnet / ikvm-maven

Support for adding dependencies on Maven artifacts to .NET projects, using IKVM.
MIT License
50 stars 5 forks source link

Cannot resolve package #39

Closed wasabii closed 9 months ago

wasabii commented 11 months ago
          @wasabii I'm sorry I am disturbing you

After adding this:

  <ItemGroup>
        <PackageReference Include="IKVM" Version="8.7.1-pre.3" />
        <PackageReference Include="IKVM.Maven.Sdk" Version="1.6.1" />
    </ItemGroup>

    <ItemGroup>
        <MavenReference Include="org.apache.calcite:calcite-core" Version="1.34.0" />
        <MavenReference Include="org.apache.calcite.avatica:avatica-server" Version="1.23.0" />
        <MavenReference Include="org.apache.calcite:calcite-csv" Version="1.34.0" /> <--- this is the refence that breaks
    </ItemGroup>

Error: 0>IKVM.Maven.Sdk.targets(96,9): Error : DependencyResolutionException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request) at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveCompileDependencyGraph(IkvmMavenEnvironment maven, RepositorySystemSession session, IList1 repositories, IList1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 254 at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveReferences(IList1 repositories, IList1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 193 at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.Execute() in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 151 ArtifactResolutionException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(RepositorySystemSession session, Collection requests) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request) ArtifactNotFoundException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html As a result all dependencies are being deleted ( aka not created )

Originally posted by @HackPoint in https://github.com/ikvmnet/ikvm/issues/438#issuecomment-1789581746

wasabii commented 11 months ago

So as far as I can tell, this is ... normal.

https://stackoverflow.com/questions/4908651/the-following-artifacts-could-not-be-resolved-javax-jmsjmsjar1-1

The deal seems to be that the JMS dependency has no JAR file in Maven Central. And the JAR file only exists in the JBoss repository. So the JBoss repository needs to be added.

jeremyosterhoudt commented 11 months ago

Is there a way to add a custom repository using the IKVM.Maven.Sdk package or would we need to download the JMS.jar independently and include it with the IkvmReference property in the project file?

wasabii commented 11 months ago

You set the MavenAdditionalRepositories property. It is a key=value set of repo IDs and URLs, seperated by semicolons.

HackPoint commented 11 months ago

@wasabii can you show an example of how to - please

wasabii commented 11 months ago

<PropertyGroup>
<MavenAdditionalRepositories>$(MavenAdditionalRepositories);myrepo=http://myrepo.com/whatever</MavenAdditionalRepositories>
</PropertyGroup>
HackPoint commented 11 months ago

@wasabii can you please explain why the assemblies aren't being generated through the IKVM transpiler? Like I shown you in issue 41

wasabii commented 11 months ago

The code you submitted to demonstrate issue #41 resulted, for me, in the error shown here on issue #39.

I am not sure what error beyond that you are talking about.

HackPoint commented 11 months ago

Still having an error with this configuration:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net7.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <MavenAdditionalRepositories>$(MavenAdditionalRepositories);myrepo=https://repository.jboss.org/nexus/content/groups/public</MavenAdditionalRepositories>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="IKVM" Version="8.7.1" />
        <PackageReference Include="IKVM.Maven.Sdk" Version="1.6.0" />
    </ItemGroup>
    <ItemGroup>
        <MavenReference Include="javax.jms:jms" Version="1.1" />
        <MavenReference Include="org.apache.calcite:calcite-core" Version="1.34.0" />
        <MavenReference Include="org.apache.calcite:calcite-server" Version="1.34.0" />
        <MavenReference Include="org.apache.calcite:calcite-csv" Version="1.34.0" />
        <MavenReference Include="org.apache.calcite:calcite-elasticsearch" Version="1.34.0" />
        <MavenReference Include="org.apache.calcite.avatica:avatica-server" Version="1.23.0" />
    </ItemGroup>
</Project>
Error  : DependencyResolutionException: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, javax.jms:jms:jar:1.1: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html
   at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request)
   at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveCompileDependencyGraph(IkvmMavenEnvironment maven, RepositorySystemSession session, IList`1 repositories, IList`1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 254
   at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveReferences(IList`1 repositories, IList`1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 193
   at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.Execute() in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 151
ArtifactResolutionException: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, javax.jms:jms:jar:1.1: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html
   at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(RepositorySystemSession session, Collection requests)
   at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request)
ArtifactNotFoundException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html
wasabii commented 11 months ago

The project file you just posted builds fine for me with no error (minus a problem inheriting from JsonTable). The error you posted indicates that the repository has not been added. So I'm not sure whether you need to rebuild or what. But, the configuration you posted works.

wasabii commented 9 months ago

No response, issue stale. Assuming fixed. Reopen if not.