-
Notifications
You must be signed in to change notification settings - Fork 3
MavenDownloadTask Advanced Scenarios
By default, <AndroidMavenLibrary>
pulls from Maven Central. Here are some examples of other parameters that can be used to specify how to obtain the Java library and .pom
.
<ItemGroup>
<AndroidMavenLibrary
Include="androidx.core:core"
Version="1.9.0"
Repository="Google" />
</ItemGroup>
<ItemGroup>
<AndroidMavenLibrary
Include="com.github.chrisbanes:PhotoView"
Version="2.3.0"
Repository="https://repository.mulesoft.org/nexus/content/repositories/public" />
</ItemGroup>
Note there is currently no support for Maven repositories that require authentication. A workaround is to procure the .jar
/.aar
and .pom
externally and add them to your project as local files. (See next section.)
<ItemGroup>
<AndroidMavenLibrary
Include="my.company:package"
Version="1.0.0"
Repository="File"
PackageFile="C:\packages\mypackage-1.0.0.jar"
PomFile="C:\packages\mypackage-1.0.0.pom" />
</ItemGroup>
Note the .pom
file must be specified in order to enable dependency checking. If you do not have a .pom
file then a regular <AndroidLibrary>
item can be used instead.
Like <AndroidLibrary>
, <AndroidMavenLibrary>
support the Bind
and Pack
attributes to determine if C# bindings should be generated and if the Java library should be included in the NuGet package, respectively. Both default to true
.
<ItemGroup>
<AndroidMavenLibrary
Include="androidx.core:core"
Version="1.9.0"
Repository="Google"
Bind="false"
Pack="false" />
</ItemGroup>