{"id":19493111,"url":"https://github.com/nuxeo/ant-assembly-maven-plugin","last_synced_at":"2025-04-25T20:30:59.744Z","repository":{"id":824685,"uuid":"14894292","full_name":"nuxeo/ant-assembly-maven-plugin","owner":"nuxeo","description":"Maven plugin for using Ant as an assembly tool","archived":false,"fork":false,"pushed_at":"2025-02-03T13:49:48.000Z","size":1362,"stargazers_count":4,"open_issues_count":9,"forks_count":6,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-04T03:11:41.687Z","etag":null,"topics":["java","maven","maven-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuxeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-03T13:23:54.000Z","updated_at":"2025-02-03T13:49:51.000Z","dependencies_parsed_at":"2024-11-10T21:26:44.380Z","dependency_job_id":"1cd96f1a-a412-4842-844b-d6bb69c2e2aa","html_url":"https://github.com/nuxeo/ant-assembly-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxeo%2Fant-assembly-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxeo%2Fant-assembly-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxeo%2Fant-assembly-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxeo%2Fant-assembly-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxeo","download_url":"https://codeload.github.com/nuxeo/ant-assembly-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250890256,"owners_count":21503459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","maven","maven-plugin"],"created_at":"2024-11-10T21:24:13.213Z","updated_at":"2025-04-25T20:30:59.736Z","avatar_url":"https://github.com/nuxeo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nThis plugins provides an advanced Ant integration within Maven, in the manner of [nuxeo-distribution-tools](https://github.com/nuxeo/nuxeo-distribution-tools) itself inspired from [maven-antrun-extended-plugin](https://java.net/projects/maven-antrun-extended-plugin).\n\nThe `AntBuildMojo` provides advanced Ant tasks for manipulating the Maven artifacts graph. It comes with various Ant tasks dedicated to building \"distribution\": filtering libraries, resolving artifacts, attaching the result to the Maven reactor for use with `install` or `deploy`...\n\nThe `IntegrationTestMojo` and `VerifyMojo` help to integrate an arbitrary build or test execution with the Maven build. A common case is executing some tasks during the `integration-test` phase, including environment setup and teardown during `pre-integration-test` and `post-integration-test` phases then raising some status during the `verify` phase, all this in respect with the common usage and convention of Maven, Ant, SureFire and FailSafe.\n\n## Goals Overview\n\nThe available plugin goals are:\n\n- `ant-assembly:build`: execute an Ant build manipulating Maven objects (artifacts, dependencies, properties, profiles, repositories, graph...). Typical usage is the build of a distribution. It is also commonly used to setup and teardown the integration test environment.\n- `ant-assembly:integration-test`: wrap the Ant executions to catch their build result and store a Surefire/Failsafe compliant summary file. Typical usage is the execution of Ant commands performing some tests.\n- `ant-assembly:verify`: read Surefire/Failsafe summary files to verify the result of integration tests. It can also read JUnit test reports, write and aggregate the results in a summary file. Typical usage is to fail the build at a different phase than the one which ran the tests, allowing environment cleanup.\n\n## Comparison with [maven-antrun-plugin](http://maven.apache.org/plugins/maven-antrun-plugin)\n\nThis `ant-assembly-maven-plugin` does much more than only running Ant: it fully integrates Ant build with Maven making together available the best of the two worlds in both directions.\n\nThe Ant build is not simply sand-boxed as an external execution which results to success or fail. The build can use the Maven objects as well as \"talking\" to Maven: attach artifacts, setup properties and profiles, edit the dependency graph...\n\nThanks to the [Eclipse aether library](http://www.eclipse.org/aether), the Ant tasks have access to the whole Maven API like any Maven plugin does.\n\n## Comparison with [maven-assembly-plugin](http://maven.apache.org/plugins/maven-assembly-plugin)\n\nBoth plugins allow to \"assemble an application bundle or distribution from an assembly descriptor\" but the `ant-assembly-maven-plugin` has been written in order to provide easy to read, write and maintain assemblies, taking benefit from the power of Ant, inspired by [maven-antrun-extended-plugin](https://java.net/projects/maven-antrun-extended-plugin).\n\nWhile the `maven-assembly-plugin` has a lot of drawbacks:\n\n- the assembly uses a custom XLM syntax, verbose, not easy to read and absolutely not maintainable over time,\n- it is quickly limited by the pre-defined descriptors and customization is not obvious,\n- it has assumptions making it mandatory to follow some assembly conventions.\n\nAt the opposite, the `ant-assembly-maven-plugin` circumvent those issues:\n\n- the assembly syntax is the well-known Ant syntax, less verbose, easy to ready and maintain,\n- it has no limitations since it provides all the Ant and Maven basic tasks, including the [Ant Contrib tasks](http://ant-contrib.sourceforge.net/), and can be extended with any Ant contribution,\n- there is no constraint on the assembly content.\n\n# Usage\n\nOnline documentation:\n\n- [ant-assembly-maven-plugin](http://nuxeo.github.io/ant-assembly-maven-plugin/plugin-info.html)\n- [maven-invoker-plugin](http://maven.apache.org/plugins/maven-invoker-plugin/)\n- [maven-surefire-plugin](http://maven.apache.org/surefire/maven-surefire-plugin/)\n\n## Examples\n\nThe whole [nuxeo-distribution](https://github.com/nuxeo/nuxeo-distribution/)\nproject is using nuxeo-distribution-tools for building Nuxeo distributions, running tests, ...\n\nLook at `nuxeo-distribution/*/pom.xml` and\n`nuxeo-distribution/*/src/main/assemble/assembly.xml` files for concrete usage samples.\n\n## Basics\n\nThe following Maven properties are exposed in the Ant build file with a `maven.` prefix:\n\n  - basedir -\u003e maven.basedir\n  - project.name -\u003e maven.project.name\n  - project.artifactId -\u003e maven.project.artifactId\n  - project.groupId -\u003e maven.project.groupId\n  - project.version -\u003e maven.project.version\n  - project.packaging -\u003e maven.project.packaging\n  - project.id -\u003e maven.project.id\n  - project.build.directory -\u003e maven.project.build.directory\n  - project.build.outputDirectory -\u003e maven.project.build.outputDirectory\n  - project.build.finalName -\u003e maven.project.build.finalName\n\nAny user defined Maven property will be available as an Ant property.\n\nFor every active Maven profile, a property of the following form is created:\n\n    maven.profile.X = true\n\nwhere X is the profile name.\n\nThis can be used in conditional Ant constructs like:\n\n    \u003ctarget if=\"maven.profile.X\"\u003e\n\nor\n\n    \u003ctarget unless=\"maven.profile.X\"\u003e\n\nto make task execution depending on whether a profile is active or not.\n\nMaven profiles are also exported as Ant profiles so you can use the custom\nnx:profile tasks to conditionally execute code. Example:\n\n    \u003cnx:profile name=\"X\"\u003e\n      ... that statement will be executed only if profile X is active ...\n    \u003c/nx:profile\u003e\n\nThe current Maven POM (project) is put as a root into the artifact graph.\n\nIf expand \u003e 0, then the project node will be expanded using a depth equals to the\nexpand property. Example: if you use expand=1, then the direct dependencies of\nthe project are added to the graph.\n\n## Ant tasks\n\n[All standard Ant tasks](http://ant.apache.org/manual/tasklist.html) are available.\n\n[Ant contrib tasks](http://ant-contrib.sourceforge.net/) are also included.\n\nAll the Nuxeo Ant tasks are listed in [src/main/resources/org/nuxeo/build/antlib.xml](src/main/resources/org/nuxeo/build/antlib.xml) and\n[src/main/resources/org/nuxeo/build/artifact/antlib.xml](src/main/resources/org/nuxeo/build/artifact/antlib.xml). Here's quick listing:\n\n- nx:templates (org.nuxeo.build.ant.ftl.ProcessTemplateTask)\n- nx:profile (org.nuxeo.build.ant.profile.ProfileTask)\n- nx:archetype (org.nuxeo.build.ant.archetype.ArchetypeTask)\n- nx:if (org.nuxeo.build.ant.IfTask)\n- nx:regexp (org.nuxeo.build.ant.PropertyRegexp)\n- nx:preprocess (org.nuxeo.build.ant.processor.NuxeoBuildProcessor)\n- nx:rename (org.nuxeo.build.ant.RenameTask)\n- nx:rmdups (org.nuxeo.build.ant.RemoveDuplicateTask)\n- nx:zipdiff (org.nuxeo.build.ant.ZipDiffTask)\n- nx:studioExtraction (org.nuxeo.build.ant.StudioExtraction)\n\n- artifact:settings (org.nuxeo.build.ant.artifact.SettingsTask)\n- artifact:set (org.nuxeo.build.ant.artifact.ArtifactSet)\n- artifact:file (org.nuxeo.build.ant.artifact.ArtifactFile)\n- artifact:graph (org.nuxeo.build.ant.artifact.GraphTask)\n- artifact:expand (org.nuxeo.build.ant.artifact.ExpandTask)\n- artifact:nuxeo-expand (org.nuxeo.build.ant.artifact.NuxeoExpandTask)\n- artifact:export (org.nuxeo.build.ant.artifact.GraphExportTask)\n- artifact:attach (org.nuxeo.build.ant.artifact.AttachArtifactTask)\n- artifact:foreach (org.nuxeo.build.ant.artifact.ArtifactForeach)\n- artifact:resolveFile (org.nuxeo.build.ant.artifact.ResolveFile)\n- artifact:dependencies (org.nuxeo.build.ant.artifact.ArtifactDependencies)\n- artifact:print (org.nuxeo.build.ant.artifact.PrintGraphTask)\n- artifact:resolveFiles (org.nuxeo.build.ant.artifact.ResolveFiles)\n\n### Graph tasks\n\n - `\u003cartifact:graph src=\"\" resolves=\"\" /\u003e`\n `src`: file containing a list of artifact keys (GAV)\n `resolves`: comma-separated list of artifact keys (GAV)\n Nested elements: `org.nuxeo.build.ant.artifact.Expand`\n Build an expanded graph with the given artifacts as root nodes.\n - `\u003cartifact:expand key=\"\" depth=\"1\" \u003e`\n `key`: the root node. The current graph is used if null.\n `depth`: expansion depth (default=\"1\"). Set \"all\" to expand at max.\n Nested elements: `org.nuxeo.build.maven.filter.AndFilter`\n Expand artifact nodes in the current graph if key is null or in the graph which key is root node.\n\n\n### Artifact File Resources\n\nArtifact file resources are used to select the file for the specified\nartifacts.\n\nYou can use classifiers if you want a specific file.\n\nThere are four artifact file resource types:\n\n    \u003cartifact:file\u003e         -\u003e selects a single artifact\n    \u003cartifact:resolveFile\u003e  -\u003e selects a single remote artifact that is not specified by the graph. This is not using the graph but directly the Maven repositories.\n    \u003cartifact:set\u003e          -\u003e selects a set of artifacts. Can use includes and excludes clauses (filters are supported).\n    \u003cartifact:dependencies\u003e -\u003e selects the dependencies of an artifact (the depth can be controlled and filters are supported).\n\n\n`\u003cartifact:file\u003e` have the following attributes:\n\n  - groupId\n  - artifactId\n  - version\n  - type\n  - classifier\n  - key\n\nYou must specify at least the 'key' attribute or one or more of the other\nattributes.\n\nIf both key and other attributes are specified the 'key' take precedence.\n\nThe key format is the same as the node artifact key format described above.\n\nExample:\n\n    \u003cartifact:file key=\"nuxeo-runtime\"\u003e will get the file of the first artifact found having the artifactId == \"nuxeo-runtime\"\n\n    \u003cartifact:file key=\"org.nuxeo.runtime:nuxeo-runtime\"\u003e will get the file of the first artifact found having the groupId == \"org.nxueo.runtime\" and artifactId == \"nuxeo-runtime\"\n\n    \u003cartifact:file key=\"nuxeo-runtime;allinone\"\u003e - the ';' is a shortcut to be able to specify the classifier inside a node key.\n\n    \u003cartifact:file artifactId=\"nuxeo-runtime\" classifier=\"allinone\"\u003e this is identical to the previous example.\n\nNote: using 'key' may generate faster lookups. (it's a prefix search on a tree map).\n\nExample:\n\n    \u003ccopy todir=\"${maven.project.build.directory}\"\u003e\n      \u003cartifact:file artifactId=\"nuxeo-runtime\"/\u003e\n      \u003cartifact:dependencies artifactId=\"nuxeo-runtime\"\u003e\n        \u003cexcludes\u003e\n          \u003cartifact scope=\"test\"/\u003e\n          \u003cartifact scope=\"provided\"/\u003e\n        \u003c/excludes\u003e\n      \u003c/artifact:dependencies\u003e\n    \u003c/copy\u003e\n\n\n\n## Thread safety\n\nDifferent Mojo instances can be used in different threads, each of them will\nhave its own graph. (The Mojo is bound to a thread variable so that Ant will\nuse the Mojo bound to the current thread).\n\n\n# How to contribute\n\nSee this page for practical information:\n[NXDOC/Contributing+to+Nuxeo](http://doc.nuxeo.com/x/VIZH)\n\nThis presentation will give you more insight about \"the Nuxeo way\":\n\u003chttp://www.slideshare.net/nuxeo/nuxeo-world-session-becoming-a-contributor-how-to-get-started\u003e\n\n## QA results\n\n[![Build Status](https://qa.nuxeo.org/jenkins/buildStatus/icon?job=tools_ant-assembly-maven-plugin-master)](https://qa.nuxeo.org/jenkins/job/tools_ant-assembly-maven-plugin-master/)\n\n## Build and tests\n\n    mvn clean package [-o] [-DskipTests] [-DskipITs] [-DdebugITs=true] [-Dinvoker.test=...] [-Pdebug]\n\n### Build and run all Unit and integration tests\n\n    mvn clean integration-test [-o] [-DdebugITs=true]\n\n### Build with no test\n\n    mvn clean package -DskipTests -DskipITs\n\n### Build and run Unit tests only (default)\n\n    mvn clean package -DskipITs\n\n### Build and run integration tests only\n\n    mvn clean integration-test -DskipTests\n\n### Run only some integration tests\n\n    mvn invoker:run -Dinvoker.test=test1\n\nor (if you want the code being compiled again):\n\n    mvn clean integration-test -Dinvoker.test=test1\n\nUse comma separator. Wildcards are accepted.\n\n### Integration tests results\n\nResults are in `target/it/*` sub-folders.\n\n### Manually replay integration tests\n\nYou can manually execute some Maven commands from a result directory (`target/it/*`) providing a specific `settings.xml` file:\n\n    mvn -s ../../../it-settings.xml ...\n\n### Integration tests debug logs\n\nAdd `-DdebugITs=true` on the command line to get debug logs in the build.log file.\n\n### Integration tests debug code (mvnDebug)\n\nUse `-Pdebug` profile which will make the invoker call mvnDebug (starting the JVM in debug attach mode).\n\nDefault listening for transport dt_socket at address: 8000\n\n## Release the project\n\nMake sure the project builds and its tests pass.\n\nThen create a temporary branch to perform the release:\n\n```bash\ngit checkout -b tmp-release\n```\n\nThen update the project version to final, for instance `2.1.7`:\n\n```bash\nmvn versions:set -DnewVersion=2.1.7 -DgenerateBackupPoms=false\n```\n\nThen commit and tag the release:\n\n```bash\ngit commit -a -m \"Release 2.1.7\"\ngit tag -a -m \"Release 2.1.7\" release-2.1.7\n```\n\nThen deploy the maven artifacts:\n\n```bash\nmvn clean deploy -DskipTests -DskipITs -DaltDeploymentRepository=maven-public-releases::default::PUBLIC_URL\n```\n\n\u003e [!IMPORTANT]\n\u003e You should replace the `PUBLIC_URL`.\n\u003e Your Maven `settings.xml` file should contain appropriate authentication (if any) for the `maven-public-releases` repository.\n\nThen push the tag:\n\n```bash\ngit push --tags\n```\n\nThen cleanup your branch and prepare the next development iteration:\n\n```bash\ngit checkout master\ngit branch -D tmp-release\nmvn versions:set -DnewVersion=2.1.8-SNAPSHOT -DgenerateBackupPoms=false\ngit commit -a -m \"Post release 2.1.7\"\ngit push\n```\n\n\n# About Nuxeo\n\nNuxeo dramatically improves how content-based applications are built, managed and deployed, making customers more agile, innovative and successful. Nuxeo provides a next generation, enterprise ready platform for building traditional and cutting-edge content oriented applications. Combining a powerful application development environment with SaaS-based tools and a modular architecture, the Nuxeo Platform and Products provide clear business value to some of the most recognizable brands including Verizon, Electronic Arts, Sharp, FICO, the U.S. Navy, and Boeing. Nuxeo is headquartered in New York and Paris. More information is available at www.nuxeo.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxeo%2Fant-assembly-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxeo%2Fant-assembly-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxeo%2Fant-assembly-maven-plugin/lists"}