jax-maven-plugin icon indicating copy to clipboard operation
jax-maven-plugin copied to clipboard

Provide custom repos for executing plugin

Open samkit993 opened this issue 3 years ago • 3 comments

I am using with jaxb2-basics dependencies in building one of the project(Oozie). I want to use custom repos to download dependencies, but it makes use of default central repo and doesn't consider the ones passed in repositories or pluginRepositories tag ? How can we enforce use of custom repos ? Use of plugin can be found here : https://github.com/apache/oozie/blob/master/fluent-job/fluent-job-api/pom.xml

samkit993 avatar Jun 29 '21 20:06 samkit993

You can specify other remote repos to the plugin using remoteRepositories parameter to the plugin. See https://github.com/davidmoten/jax-maven-plugin/blob/master/jax-maven-plugin/src/main/java/com/github/davidmoten/jaxws/BaseMojo.java.

davidmoten avatar Jun 30 '21 05:06 davidmoten

I have tried this and got following error : Unable to parse configuration of mojo com.github.davidmoten:jax-maven-plugin:0.1.8:xjc for parameter remoteRepository: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository: org.apache.maven.artifact.repository.ArtifactRepository.<init>()

remoteRepositories block look as below: <remoteRepositories> <remoteRepository> <id>central</id> <url>custom-url</url> </remoteRepository> </remoteRepositories>

It has something to do with type of remoteRepositories in BaseMojo which is List of interface org.apache.maven.artifact.repository.ArtifactRepository. Can we specify implementation with this tag ?

samkit993 avatar Jun 30 '21 07:06 samkit993

Ok I see. Can you do some research on this one and submit a PR? I think those parameters aren't supposed to be public and are used to get injected the default values only.

davidmoten avatar Jun 30 '21 09:06 davidmoten