How do you configure Amper to fetch dependencies f...
# amper
r
How do you configure Amper to fetch dependencies from and publish artifacts to Maven local?
a
Currently, dependency resolve does not support directories as repositories input. It should and we have a task about it.
👍 1
j
@andrey.dernov I believe it is already possible to use the string
mavenLocal
as a repository URL for the local maven repo specifically. We don't need to support arbitrary directories for this
r
@Joffrey I missed that you replied. Should that be done like this?
Copy code
repositories
  - mavenLocal
And how would I apply that to publishing? Would that be this
Copy code
publishing:
  - type: mavenLocal
    groupId: ...
    artifactId: ...
or this
Copy code
publishing:
  - type: Maven
    groupId: ...
    artifactId: ...
    repository: mavenLocal
Or is that what this is for?
Copy code
publishing:
  - maven: lib        
    groupId: ...
    artifactId: ...
j
@Ruckus Sorry for the late response. First, please note that this behavior is not officially documented. If you want to use it, you would declare the repository like this (both
id
and
url
should have this special value):
Copy code
repositories:
  - id: mavenLocal
    url: mavenLocal
When using Amper in a Gradle build, this will translate to declaring
mavenLocal()
as a repository for your project, which means you can now fetch dependencies from maven local. Regarding publishing, you should be able to use the
publishToMavenLocal
task even without this setup.
r
Awesome, thanks. I assume then there's no publish equivalent for Amper standalone?
j
> I assume then there's no publish equivalent for Amper standalone? It's not officially documented yet, but there is a general work in progress for publication in Amper standalone too. I believe you should be able to use the same
module.yaml
and just run:
Copy code
./amper publish mavenLocal
Or
Copy code
./amper task publishToMavenLocal
Although note that the publication in Amper standalone is still WIP and might not be completely implemented. For instance, KMP publications will be incomplete (pure JVM libs should be fine).
r
Okay, cool. Thanks for all the help and info.