IDEA is now open source! The free community edition at http://www.jetbrains.org is all you need for Cassandra development. (You don't need J2EE or Web tools.)
Since 2.1.5, there is a new ant target generate-idea-files
for trunk branch (JDK7 required)
git clone git://git.apache.org/cassandra.git |
for cassandra-2.1 branch
git clone –b cassandra-2.1 git://git.apache.org/cassandra.git |
2. Once git has finished cloning the repository, generate the eclipse files using ant.
ant generate-idea-files |
3. Start IDEA 4. Just open the IDEA project from the checked out Cassandra directory using the menu item Open in IDEA's File menu
The project generated by the ant task generate-idea-files
contains nearly everything you need to debug Cassandra and execute unit tests.
To quickly import Cassandra into IntelliJ and start coding simply:
(The IntelliJ Eclipse plugin must be enabled.)
If you want IDEA to handle more of the environment for you, keep reading.
for trunk branch (JDK7 required)
git clone git://git.apache.org/cassandra.git |
for cassandra-1.2 branch
git clone –b cassandra-1.2 git://git.apache.org/cassandra.git |
2. Once git has finished cloning the repository, generate the eclipse files using ant.
ant generate-eclipse-files |
3. Start IDEA 4. Click Import Project. 5. Navigate to the newly cloned cassandra directory and click OK.
6. Select Import project from external model, pick Eclipse then click OK.
7. Select Next - make sure that Link created IntelliJ IDEA modules to Eclipse project files is checked
8. Select cassandra and click Finish. You now have a successfully imported Cassandra project.
To build Cassandra we need to import ant's build file, aka build.xml.
Building / Testing Cassandra via Ant
Once the ant build file is added to IDEA you can compile cassandra via the build target. The unit tests are located under the test target.
To run a target select it and then click .
Main class: org.apache.cassandra.service.CassandraDaemon VM options: -Dcassandra-foreground=yes -Dcassandra.config=file://$PROJECT_DIR$/conf/cassandra.yaml -Dcassandra.storagedir=$PROJECT_DIR$/data -Dlogback.configurationFile=file://$PROJECT_DIR$/conf/logback.xml -Dcassandra.logdir=$PROJECT_DIR$/data/logs -ea -Xmx1G |
3. Click OK.
If everything is configured correctly, when you run Cassandra (via or Run > Run...) logs should appear in the IDEA console.
Once cassandra is started, you can also check it's up and running by connecting to it via cqlsh
$ ./cqlsh Connected to Test Cluster at localhost:9160. [cqlsh 3.1.8 | Cassandra 1.2.11-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.36.1] Use HELP for help. cqlsh> |
Dont forget to update IntelliJ to use JDK7 or later for Cassandra versions greater than Cassandra 1.2
https://c.statcounter.com/9397521/0/fe557aad/1/|stats
If you did not check Link created IntelliJ IDEA modules to Eclipse project files in the project import dialog, you can change that later and IDEA will automatically use changes if .classpath file is regenerated using
ant generate-eclipse-files |