7 Compiling AreaShop
Thijs Wiefferink edited this page 2017-02-21 20:16:26 +01:00

AreaShop is a Maven project with a couple of modules (these modules are to support multiple versions of the dependencies).

Compile using Intellij IDEA

  1. Startup Intellij IDEA
  2. Go to File > New > Project from Version Control > Git.
  3. Enter https://github.com/NLthijs48/AreaShop.git into the Git Repository URL field.
  4. Select the directory you want to put the project in.
  5. Click the Clone button
  6. Click the Add as Maven Project link in the notification you get in the bottom right corner (if you missed it: View > Tool Windows > Event Log)
  7. Create a build configuration to build the jar file:
  8. Click the downwards arrow in the top right corner next to the grayed out play icon, then click Edit Configurations
  9. Click the green plus button and select the Maven entry.
  10. Enter a name, something like Build jar.
  11. Change the work directory to the directory of the project itself.
  12. In the Command line field enter install.
  13. Optional: in the general tab deselect the Use project settings checkbox and enter 1C into the Threads field. This will make the build use as much threads as cpu cores your machine has and speeds up the compilation.
  14. Click the OK button.
  15. Now click the green play button in the top right corner.
  • If you get an error like Project SDK is not specified fix this by clicking the Configure link it shows and select your Java SDK (you might need to click the new button and select the JDK you have installed, on Windows this would be located at C:/Program Files/Java/jdk<version> or C:/Program Files (x86)/Java/jdk<version>)
  1. It is now building AreaShop, which will (especially the first time) take a while.
  2. If it shows a BUILD SUCCESS in the end it has worked, and the jar of AreaShop can be found in the AreaShop/target/ folder of your project. If you encounter problems, try googling them first and if that does not work create an issue.

Compile using the command line

  1. Navigate to the directory you want the project in: cd path/to/directory.
  2. Clone the repository: git clone https://github.com/NLthijs48/AreaShop.git.
  3. Go to the cloned repository: cd AreaShop.
  4. Make sure maven is installed (the mvn command is required), see this guide.
  5. Run a Maven build: mvn install (or mvn package if you don't want it in your local repository).
  6. The result can be found in AreaShop/target/.

Build options

There are a couple extra options you can use with the Maven build (add these options after the install command):

  • Source: generate a jar file that has the sources of the project, add -Dsources
  • Javadoc: generate javadocs to the given directory, add -Djavadocs=path/to/target/folder
  • Build number: add a suffix to the build number (used by the Jenkins build server), add -Dbuild.number=abc
  • Copy jar file: copy the resulting jar file to the given location (automatic installation on your test server), add -DcopyResult=path/to/plugins/folder