Here’s the build for the library:
`
thufir@mordor:~/java/hello_api$
thufir@mordor:~/java/hello_api$ gradle clean build
:clean
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
:test
net.bounceme.mordor.hello.TestJunit > testPrintMessage STANDARD_OUT
Hello World
net.bounceme.mordor.hello.TestJunit > testPrintMessage PASSED
:check
:build
BUILD SUCCESSFUL
Total time: 5.927 secs
thufir@mordor:~/java/hello_api$
thufir@mordor:~/java/hello_api$ jar -tf build/libs/hello_api-0.0.1.jar
META-INF/
META-INF/MANIFEST.MF
net/
net/bounceme/
net/bounceme/mordor/
net/bounceme/mordor/hello/
net/bounceme/mordor/hello/HelloLibrary.class
thufir@mordor:~/java/hello_api$
`
The client of this hello world library fails to build:
`
thufir@mordor:~/java/hello_gradle$
thufir@mordor:~/java/hello_gradle$ gradle clean build
:clean
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava
FAILURE: Build failed with an exception.
- What went wrong:
Could not resolve all dependencies for configuration ‘:testCompile’.
Could not find net.bounceme.mordor:hello_api:0.0.1.
Searched in the following locations:
https://repo1.maven.org/maven2/net/bounceme/mordor/hello_api/0.0.1/hello_api-0.0.1.pom
https://repo1.maven.org/maven2/net/bounceme/mordor/hello_api/0.0.1/hello_api-0.0.1.jar
https://raw.github.com/thufir/hello_api/master/net/bounceme/mordor/hello_api/0.0.1/hello_api-0.0.1.pom
https://raw.github.com/thufir/hello_api/master/net/bounceme/mordor/hello_api/0.0.1/hello_api-0.0.1.jar
Required by:
:hello_gradle:unspecified
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or
–debug option to get more log output.
BUILD FAILED
Total time: 22.745 secs
thufir@mordor:~/java/hello_gradle$
`
I see that there are binaries at:
which seems odd, because it’s not standard to include binaries in a repo,
is it?
I tried to upload my JAR to releases, but they only support ZIP – JAR
files are ZIP files, so, not sure what to make of that.
How do I upload my JAR file, hello_api, on to releases? Or, do I need to
make a “releases” repo on github and just add the JAR?