Skip to content
Maven archetype for c/c++ sample project for CLion using NAR plugin
Branch: master
Clone or download syncing repos
Latest commit 38f624e Nov 23, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
clion-executable syncing repos Nov 24, 2017
clion-executable-new-project.bat maven project for clion ide initial commit Feb 25, 2016


Simple C/C++ project archetype for CLion IDE and Maven NAR plugin. This archetype will generate a simple and ready to be used project for the outstanding CLion IDE.
It uses the Maven NAR plugin to take advantage of repositories of dependencies/libraries and a standard lifecycle model for projects (it is used as a de facto standar in Java). Now you could code in your favorite IDE (CLion obviously) and compile, test and install/deploy your C/C++ projects/libraries in a local or external repository. For now, CLion doesn't support the Maven NAR plugin, you will need to use the Terminal (ALT+F12) to send simple commands like "mvn compile". Then, if you want to use your library in another project you only need to add the dependency in your pom.xml like this:


For starters you need to:

  1. have Maven installed (and know the basics of it)
  2. install the archetype (clion-executable-install.bat)
  3. create a project using the archetype (clion-executable-new-project.bat)
  4. use a command line and execute mvn test (your compiler must be in your PATH or you could configure it in pom.xml)

Using dependencies/libraries

  1. add your required <dependencies/> in pom.xml
  2. execute mvn compile in the Terminal (Maven will bring your dependencies headers and libraries)
  3. add the include_directories and target_link_libraries in CMakeLists.txt and reload the project.
  4. enjoy CLion! You could find some library dependencies in and

Making your own dependencies/libraries

If you want to build your own dependencies from compiled libraries follow this SO answer (don't forget to give +1):

For system libraries you can add them in your source or use <linker/> in the pom.xml file:

    #pragma comment(lib, "user32.lib")
    #pragma comment(lib, "gdi32.lib")
    #pragma comment(lib, "advapi32.lib")

Every dependency marked as a static or shared library could be used in other projects.

  1. modify the <configuration/> on your pom.xml

         <!-- shared library
  2. open the terminal and compile (mvn compile) and install your library on the repository (mvn install)

  3. open your project and add the dependency in your pom.xml, for example:


Configure your compiler

For setting which toolset and sdk to use, you could override automatic detection with the next configuration in your pom.xml. In older versions this will fix some issues too


Finally, you should visit:

You can’t perform that action at this time.