google / certificate-transparency

Auditing for TLS certificates.
https://certificate.transparency.dev
Apache License 2.0
869 stars 283 forks source link

Split java code into two modules #1376

Closed alexanderkjall closed 7 years ago

alexanderkjall commented 7 years ago

I think it might be better to organize the java code in a library part and a client part.

That way the library part can be uploaded into maven central and reused by other projects without them getting the main class in their class path.

My suggestion is to do this by setting up the maven project to be multi-module, with a library module and client module.

pphaneuf commented 7 years ago

Can this be done without affecting the organisation of the code in the repository? (genuine question from a non-Java person here!)

alexanderkjall commented 7 years ago

Quick answer: no.

Long answer: Right now the (maven) java code layout is this:

* java
** src
*** main
*** test
** pom.xml

This proposal would move it into something like this:

* java
** lib
*** src
**** main
**** test
*** pom.xml
** client
*** src
**** main
**** test
*** pom.xml
** pom.xml

This would also make the java code produce two different artifacts, one from the library module that would be suitable to distribute to maven central, and one from the client module, that would be suitable to distribute from somewhere else, as maven central is for dependencies.

pphaneuf commented 7 years ago

OK, but all changes remaining within the java subdirectory of this repository, and all tests would still be executed on Travis... Good.

pphaneuf commented 7 years ago

I'd suggest holding off on that, though, as per my comment on #1375.

alexanderkjall commented 7 years ago

No problem :)

My main motivation is to be able to read data from a CT log in my project. Right now I have achieved this by copying all the java classes from this project into mine. I thought that it be some quick community service to help you with getting your artifacts onto maven central, so that I can depend on an more official release.

Just drop me a message when you have finished your reorganisation.

pphaneuf commented 7 years ago

Excellent! And your "quick" community service is greatly appreciated. :smiley:

I'll watch for your PR getting merged, try to get that done quickly afterwards, and update this issue once it's done.

pphaneuf commented 7 years ago

I've now moved the Java code to its own separate repository:

https://github.com/google/certificate-transparency-java

This should generally leave you with a lot more freedom to propose such reorganisations. I'll close this issue here, feel free to create an equivalent one over there.