XMvn supports local resolution of Ivy artifacts, their installation and requires generation.
Using the `ivy:publish` task
This method of artifact installation allows using other XMvn macros such as `%mvn_alias` or `%mvn_package`
The publish target may be named differently. Search the `build.xml` for occurences of `ivy:publish`.
Spec file using the `ivy:publish` task
Spec file
# Remove dependency on artifact with org="com.example" and
# name="java-project" from ivy.xml file in current directory
%pom_remove_dep com.example:java-project
`%mvn_install` will install all the published artifacts.
`%mvn_install` performs the actual installation. Optional `-J` parameter requests installation of generated Javadoc from given directory
%mvn_install -J api/
`%mvn_install` generates `.mfiles` file which should be used to populate `%files` section with `-f` switch. For each subpackage there would be separate generated file named `.mfiles-subpackage-name`
`%mvn_artifact` supports installing artifacts described by Ivy configuration files
`%mvn_artifact` macro is used to request installation of an artifact that was not built using Maven. It expects a POM file and a JAR file. For POM only artifacts, the JAR part is omitted. + See xref:mvn_macros.adoc#mvn_artifact[Installing additional artifacts] for more information
Ivy supports publishing built artifact with `ivy:publish` task. If your `build.xml` file already contains a task that calls `ivy:publish`, you can set the resolver attribute of the `ivy:publish` element to `xmvn`. This can be done with simple `%pom_xpath_set` call. Then when the task is run, XMvn can pick the published artifacts and install them during the run of `%mvn_install` without needing you to manually specify them with `%mvn_artifact`.
Ivy files manipulation
%mvn_install -J api/
%mvn_artifact pom.xml lib/%{name}.jar
%mvn_artifact ivy.xml lib/sample.jar
If upstream ships a Maven POM file, it must be installed even if you don't build with Maven. If not you should try to search Maven Central Repository for it, ship it as another source and install it.
If there is an `ivy-settings.xml` or similar file, which specifies remote repositories, it needs to be disabled, otherwise it would override local resolution.