First, let's assume you have an Ant build that successfully loads the Ivy tasks as an antlib. You need to load some custom ivy settings that tell Ivy where to publish artifacts (note that the realm must match this example):
Here is the confusing part. Your project needs to explicitly define the artifacts it will publish in the publications element of your project's custom Ivy settings. In this case, the project defines a single "publication": simple-project of type "jar". This list of publications will be used later in this process during the publish task.
Next step is to verify that your ivy.xml file contains a valid organisation and (Ivy uses English spelling throughout the project). Here's and example of the first line of the ivy.xml file:
Once you've done this, you are ready to publish artifacts. You'll need to generate a pom.xml file prior to publishing. Run these four Ant tasks together, and you'll have successfully published an artifact to Nexus using Apache Ivy:
After all of this configuration, you'll be able to publish a SNAPSHOT artifact, but Ivy doesn't support publishing SNAPSHOT artifacts with timestamps. If you needed to publish a release artifact, just change all the revisions to a release version number and switch the ivy:publish task to publish to nexus-releases.