English
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.
%install
%mvn_artifact ivy.xml lib/sample.jar
%install
%mvn_artifact pom.xml lib/%{name}.jar
%install
%mvn_install -J api/
Ivy files manipulation
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`.
`%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
`%mvn_artifact` supports installing artifacts described by Ivy configuration files
`%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_install -J api/
`%mvn_install` performs the actual installation. Optional `-J` parameter requests installation of generated Javadoc from given directory
`%mvn_install` will install all the published artifacts.
# 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
Spec file
Spec file using the `ivy:publish` task
The publish target may be named differently. Search the `build.xml` for occurences of `ivy:publish`.
This method of artifact installation allows using other XMvn macros such as `%mvn_alias` or `%mvn_package`
Using the `ivy:publish` task
XMvn supports local resolution of Ivy artifacts, their installation and requires generation.