kyonifer / koma

A scientific computing library for Kotlin. https://kyonifer.github.io/koma
Other
270 stars 23 forks source link

can not add repository #34

Closed amangautam1 closed 6 years ago

amangautam1 commented 6 years ago

On adding the repository in the Gradle I am getting the following error.

Java: file not found Exception Resource nexus-maven-repository-index-properties does not exist

img_20170720_031330

kyonifer commented 6 years ago

Hi,

How are you adding koma to your project? For a gradle project, you'll want to add koma into the repositories block of your build.gradle file.

For example, here's a build.gradle for a Java project thats configured to use koma:

apply plugin: "java"
apply plugin: "application"

mainClassName="Hello"

repositories { 
    maven { 
        url "http://dl.bintray.com/kyonifer/maven" 
        jcenter()
    } 
}
dependencies{
    compile "koma:backend-matrix-mtj:0.10"
    compile "koma:core:0.10"
}

then making src/main/java/Hello.java contain:

class Hello {
    public static void main(String [] args) {
        System.out.println(koma.Koma.zeros(3,3));
    }
}

now running it on the command line I get:

❯ gradle run
:compileJava UP-TO-DATE
:processResources NO-SOURCE
:classes UP-TO-DATE
:run
mat[ 0.00,  0.00,  0.00 end
     0.00,  0.00,  0.00 end
     0.00,  0.00,  0.00 ]

If you're running things from intellij make sure you refresh the gradle project after changing the build.gradle file.

If you're using maven instead of gradle you can find the xml snippet here to add.

amangautam1 commented 6 years ago

this is my gradle file and i am still getting same error.

version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = '1.1.3-2'

    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: 'kotlin'
apply plugin: 'application'

mainClassName = "_DefaultPackage"

repositories {
    maven {
        url "http://dl.bintray.com/kyonifer/maven"
        jcenter()
    }
}
dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    compile "com.marcinmoskala:DiscreteMathToolkit:1.0.2"
    compile 'com.github.kevinsawicki:http-request:6.0'
    compile "koma:backend-matrix-mtj:0.10"
    compile "koma:core:0.10"

}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
kyonifer commented 6 years ago

I can't reproduce. With your build.gradle I get:

❯ gradle build
:compileKotlin
Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.1.3-2/kotlin-stdlib-jre8-1.1.3-2.pom
Download https://jcenter.bintray.com/com/github/kevinsawicki/http-request/6.0/http-request-6.0.pom
Download https://jcenter.bintray.com/com/marcinmoskala/DiscreteMathToolkit/1.0.2/DiscreteMathToolkit-1.0.2.pom
Download http://dl.bintray.com/kyonifer/maven/koma/backend-matrix-mtj/0.10/backend-matrix-mtj-0.10.pom
Download http://dl.bintray.com/kyonifer/maven/koma/core/0.10/core-0.10.pom
Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.1.3-2/kotlin-stdlib-jre7-1.1.3-2.pom
Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.1.3-2/kotlin-stdlib-jre8-1.1.3-2.jar
Download https://jcenter.bintray.com/com/github/kevinsawicki/http-request/6.0/http-request-6.0.jar
Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.1.3-2/kotlin-stdlib-jre7-1.1.3-2.jar
Download https://jcenter.bintray.com/com/marcinmoskala/DiscreteMathToolkit/1.0.2/DiscreteMathToolkit-1.0.2.jar
:compileJava
:copyMainKotlinClasses
:processResources NO-SOURCE
:classes
:jar
:startScripts
:distTar
:distZip
:assemble
:compileTestKotlin NO-SOURCE
:compileTestJava NO-SOURCE
:copyTestKotlinClasses
:processTestResources NO-SOURCE
:testClasses UP-TO-DATE
:test NO-SOURCE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL in 6s
8 actionable tasks: 8 executed

What does gradle build give you?

kyonifer commented 6 years ago

Doing a search for your error leads to here, which notes there's an open issue for user bintray repositories not indexing correctly in intellij. This appears to be the exact issue you're running into.

Following the steps noted in that bug report (pressing 'Update' in File | Settings | Build, Execution, Deployment | Build Tools | Maven | Repositories for the created repository) I'm able to reproduce your error. Reimporting the project eliminates it until I try to update the repository index again.

Closing this as I'm fairly confident this isn't anything to do with koma and is the above bug in intellij's indexer.