Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Java jar path to comply with CRAN publishing rules #33

Open
tc opened this issue Mar 27, 2015 · 6 comments
Open

Fix Java jar path to comply with CRAN publishing rules #33

tc opened this issue Mar 27, 2015 · 6 comments

Comments

@tc
Copy link
Owner

tc commented Mar 27, 2015

After submitting to CRAN, got this reply:

This is not the way to submit to CRAN: see the CRAN policies.

You did not check as per the policies, and missed

Package has FOSS license, installs .class/.jar but has no 'java' directory.

" Source packages under an Open Source license must provide source or something which can easily be converted back to source (e.g., .rda files) for all components of the package (including for example PDF documentation, configure files produced by autoconf). For Java .class and .jar files, the sources should be in a top-level java directory in the source package (or that directory should explain how they can be obtained). "

@tc tc changed the title Can't Publish to CRAN Fix Java jar path to comply with CRAN publishing rules Mar 27, 2015
@tc tc closed this as completed Apr 2, 2015
@tc tc reopened this Apr 3, 2015
@tc
Copy link
Owner Author

tc commented Apr 3, 2015

Code doesn't compile:

  >   mongo <- mongoDbConnect("test")
Error in .jnew("rmongo/RMongo", dbName, host, as.integer(port)) :
   java.lang.ClassNotFoundException
Calls: mongoDbConnect ... new -> initialize -> initialize -> .jnew ->
.External
…

@oziade
Copy link

oziade commented May 19, 2015

I'm new to R so sorry if i'm wrong.
The exception is thrown because the r-mongo-scala-1.0-SNAPSHOT.jar is not in the classpath.
You can see the classpath used at runtime with print(.jclassPath())

I fix this issue by moving the java directory into the old inst directory, as before your last commit. Otherwise, the java directory with the jar is not copied in the package installation (you can see this directory location with print(system.file(package = "RMongo"))).

Maybe there is an other way to fix this without the inst directory.
If you want, i can add a PR.

@tc
Copy link
Owner Author

tc commented May 22, 2015

Thanks @oziade we can move it back, but CRAN won't let me publish unless the java jar file is in source package. I would like to get this updated package updated in CRAN.

@oziade
Copy link

oziade commented May 26, 2015

As i understand the error message in your first comment, i think CRAN just need the source for building jar in the java top level directory, not the jar itself, which could be kept in the inst directory.
If you look in this R package, the java directory contains the java source file. I don't know if the scala file is enough in this case.

But i'm not very familiar with CRAN policy !

@tc
Copy link
Owner Author

tc commented May 27, 2015

Thanks, i'll try that and re-submit.

tc pushed a commit that referenced this issue May 27, 2015
@svensteudter
Copy link
Contributor

@tc have you tried to re-submit RMongo to CRAN? If still the same reason for rejecting are valid, the following could solve the isue, accoridng CRAN policy:
"For Java .class and .jar files, the sources should be in a top-level java directory in the source package (or that directory should explain how they can be obtained)."

So, all you need to do is add a "java" folder which is not empty. If the folder is empty it is removed during building. Just add a README file in there, with a link to the java driver source of MongoDB driver; the releases are on Github, see here:
https://github.com/mongodb/mongo-java-driver/releases

That should fix at least the mentioned "note" from CRAN. You can check for CRAN compliance by running R CMD check --as-cran -> should result in no errors, no warnings and no notes (except a note for who is maintainer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants