Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 2.91 KB

File metadata and controls

50 lines (40 loc) · 2.91 KB

IKVM.Maven.Sdk

MSBuild extensions for referencing Maven artifacts within .NET SDK projects. Maven resolution (maven-resolver/Aether) runs in-process through IKVM.

Attribution

Never mention Claude, AI tools, or AI assistance anywhere. Not in git commits, PR titles or bodies, code comments, XML documents, or generated files — no Co-Authored-By trailer, no "generated with" line, no bot attribution of any kind. The user is responsible for the work; the commit message says what changed and why, written like a normal person would.

Layout

project job
IKVM.Maven.Sdk the NuGet SDK package: props/targets under buildTransitive/ wire the task pipeline
IKVM.Maven.Sdk.Tasks the MSBuild tasks: item prepare, resolve (Aether), packed-POM write/import
IKVM.Maven.Sdk.Tasks.Java ikvmproj that compiles the Java side (maven-resolver, maven-model, slf4j)
IKVM.Maven.Sdk.Tasks.Tests MSTest + FluentAssertions + Moq; several tests resolve live against repo1.maven.org
IKVM.Maven.Sdk.Tests end-to-end SDK tests (build sample projects)

Item flow: MavenReferenceMavenReferenceItem (targets) → MavenReferenceItemPrepareMavenReferenceItemResolveIkvmReferenceItem. Items round-trip through MavenReferenceItemMetadata.Save/Import — any new metadata must be added to both sides or it is silently dropped at the next task boundary. Packages carry a partial POM (maven/<tfm>/<id>.pom, group ikvm.nuget) written by MavenWriteProjectObjectModelFile and read back by MavenReferenceItemImport; IKVM POM extensions live in the http://ikvm.org/POM-EXT/1.0.0 namespace nested inside <dependency> nodes, and are stripped before the strict DefaultModelReader parse.

Conventions

  • Block-scoped namespaces (namespace Foo { }), matching the existing code.
  • /// XML docs on every member, including private ones; <summary> on its own lines.
  • Argument null checks (throw new ArgumentNullException(nameof(x))) at the top of methods.
  • Errors surface as MavenTaskException (plain message) or MavenTaskMessageException (resource name + args); user-facing strings live in Resources/SR.resx with MAVEN00xx codes. The SR.Designer.cs accessors are not regenerated by CLI builds — runtime lookup goes through SR.ResourceManager by name, so adding a resx entry is sufficient.

Building and testing

  • dotnet build src/IKVM.Maven.Sdk.Tasks.Tests/IKVM.Maven.Sdk.Tasks.Tests.csproj builds the tasks and their Java dependencies; IKVM0101 warnings about multi-release-jar module-info classes are pre-existing noise.
  • Tests run on Microsoft.Testing.Platform, not VSTest: dotnet test --filter is ignored (MTP0001). Run the built exe directly: src/IKVM.Maven.Sdk.Tasks.Tests/bin/Debug/net8.0/IKVM.Maven.Sdk.Tasks.Tests.exe --filter "FullyQualifiedName~...".
  • Many resolve tests hit repo1.maven.org live; the full Tasks test run takes under a minute.