Skip to content

Commit

Permalink
Revert "LUCENE-9433: Remove Ant support from trunk"
Browse files Browse the repository at this point in the history
This reverts commit 37cd17d
  • Loading branch information
Erick Erickson authored and Erick Erickson committed Aug 21, 2020
1 parent 77ca552 commit c9c7581
Show file tree
Hide file tree
Showing 149 changed files with 14,322 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Please review the following and check all that apply:
- [ ] I have created a Jira issue and added the issue ID to my pull request title.
- [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [ ] I have developed this patch against the `master` branch.
- [ ] I have run `./gradlew check`.
- [ ] I have run `ant precommit` and the appropriate test suite.
- [ ] I have added tests for my changes.
- [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
72 changes: 53 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Apache Lucene is a high-performance, full featured text search engine library
written in Java.

Apache Solr is an enterprise search platform written in Java and using Apache Lucene.
Apache Solr is an enterprise search platform written using Apache Lucene.
Major features include full-text search, index replication and sharding, and
result faceting and highlighting.

Expand All @@ -40,30 +40,48 @@ comprehensive documentation, visit:

(You do not need to do this if you downloaded a pre-built package)

### Building with Ant

Lucene and Solr are built using [Apache Ant](http://ant.apache.org/). To build
Lucene and Solr, run:

`ant compile`

If you see an error about Ivy missing while invoking Ant (e.g., `.ant/lib does
not exist`), run `ant ivy-bootstrap` and retry.

Sometimes you may face issues with Ivy (e.g., an incompletely downloaded artifact).
Cleaning up the Ivy cache and retrying is a workaround for most of such issues:

`rm -rf ~/.ivy2/cache`

The Solr server can then be packaged and prepared for startup by running the
following command from the `solr/` directory:

`ant server`

### Building with Gradle

As of 9.0, Lucene/Solr uses [Gradle](https://gradle.org/) as the build
system. Ant build support has been removed.
There is ongoing work (see [LUCENE-9077](https://issues.apache.org/jira/browse/LUCENE-9077))
to switch the legacy ant-based build system to [gradle](https://gradle.org/).
Please give it a try!

At the moment of writing, the gradle build requires precisely Java 11
(it may or may not work with newer Java versions).

To build Lucene and Solr, run (`./` can be omitted on Windows):

`./gradlew assemble`


The command above packages a full distribution of Solr server; the
The command above also packages a full distribution of Solr server; the
package can be located at:

`solr/packaging/build/solr-*`

Note that the gradle build does not create or copy binaries throughout the
source repository so you need to switch to the packaging output folder above;
the rest of the instructions below remain identical. The packaging directory
is rewritten on each build.

For development, especially when you have created test indexes etc, use
the `./gradlew dev` task which will copy binaries to `./solr/packaging/build/dev`
but _only_ overwrite the binaries which will preserve your test setup.
source repository (like ant build does) so you need to switch to the
packaging output folder above; the rest of the instructions below remain
identical.

## Running Solr

Expand All @@ -86,24 +104,40 @@ Common options are described in some detail in solr/README.txt. For an
exhaustive treatment of options, run `bin/solr start -h` from the `solr/`
directory.

## Development/IDEs

Ant can be used to generate project files compatible with most common IDEs.
Run the ant command corresponding to your IDE of choice before attempting to
import Lucene/Solr.

- *Eclipse* - `ant eclipse` (See [this](https://cwiki.apache.org/confluence/display/solr/HowToConfigureEclipse) for details)
- *IntelliJ* - `ant idea` (See [this](https://cwiki.apache.org/confluence/display/lucene/HowtoConfigureIntelliJ) for details)
- *Netbeans* - `ant netbeans` (See [this](https://cwiki.apache.org/confluence/display/lucene/HowtoConfigureNetbeans) for details)

### Gradle build and IDE support

- *IntelliJ* - IntelliJ idea can import the project out of the box.
Code formatting conventions should be manually adjusted.
- *Eclipse* - Not tested.
- *Netbeans* - Not tested.

## Running Tests

### Gradle build and tests
The standard test suite can be run with the command:

`./gradlew assemble` will build a runnable Solr as noted above.
`ant test`

Like Solr itself, the test-running can be customized or tailored in a number or
ways. For an exhaustive discussion of the options available, run:

`ant test-help`

### Gradle build and tests

`./gradlew check` will assemble Lucene/Solr and run all validation
tasks unit tests.
Run the following command to display an extensive help for running
tests with gradle:

`./gradlew help` will print a list of help commands for high-level tasks. One
of these is `helpAnt` that shows the gradle tasks corresponding to ant
targets you may be familiar with.
`./gradlew helpTests`

## Contributing

Expand Down
Loading

0 comments on commit c9c7581

Please sign in to comment.