maven-nar/nar-maven-plugin

Usage with intellij

Dragas opened this issue · 1 comments

Intellij synchronizes its project configuration with the provided maven pom.xmls. On paper this seems to work alright, but there are two issues.

First one is that NarSystem class isn't available prior calling javah goal atleast once. Since it's put in target/nar/nar-generated, by default intellij does not index that class as target folder is ignored, although you can specify that nar-generated contains sources, it's a redundant step in setting up the project on another machine, but if you were to put generated classes in src/main/gen folder, that folder is indexed by default. How do you specify in your plugin to put the generated NarSystem class into src/main/gen folder?

Second one is that if you were to add a <type>nar</type dependency into another module, Intellij is unable to add classes from that dependency into the module's classpath. So far I'm using the following workaround

        <dependency>
            <groupId>lt.saltyjuice.dragas.chip</groupId>
            <artifactId>libnativeclock</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>nar</type>
        </dependency>
        <dependency>
            <groupId>lt.saltyjuice.dragas.chip</groupId>
            <artifactId>libnativeclock</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

But this causes builds to fail as libnativeclock module is in nar format, not jar, which is what maven defaults compilation to. Is there a workaround for the second issue?

Cheers.

Have you tried adding nar to File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing Dependency types field?