freepascal / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Mockito's sources in the central Maven repository should be in a *-sources.jar file #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, in http://repo1.maven.org/maven2/org/mockito/, the binaries and 
sources of 
Mockito are packed in the same JAR file (e.g. mockito-all-1.7.jar). This is 
against 
the Maven conventions. As a result, at least IntelliJ IDEA does not 
automatically 
detect the sources (i.e. no quick access to documentation, no seeing of method 
parameter names).

The convention in Maven is to have the binaries in one JAR, the sources in 
another JAR 
whose name is prefixed "-sources" and the javadocs in a third JAR prefixed 
"-javadoc". 
See http:// 
maven.apache.org/guides/mini/guide-central-repository- 
upload.html#Manual_upload_of_artifacts

The expected way to organize the files is:

mockito-all-X.Y.jar  -- the .class files and everything that is required at 
runtime
mockito-all-X.Y-sources.jar  -- the .java files and other sources
mockito-all-X.Y-javadoc.jar  -- the javadocs (I don't use them, but maybe 
someone else 
likes them)

Organizing them like this makes the library compatible with all Maven users. An 
added 
benefit is that the binaries JAR becomes about 50% smaller, because the source 
code 
will be in a separate file.

Original issue reported on code.google.com by esko.luo...@gmail.com on 24 Apr 2009 at 9:15

GoogleCodeExporter commented 9 years ago
Thanks for reporting. I didn't check with IntelliJ - eclipse dealt just fine 
with
sources inside jars. We'll fix it in upcoming release.

Original comment by szcze...@gmail.com on 25 Apr 2009 at 6:58

GoogleCodeExporter commented 9 years ago
vote here: http://jetbrains.net/jira/browse/IDEA-15406

Original comment by szcze...@gmail.com on 12 May 2009 at 9:38

GoogleCodeExporter commented 9 years ago
The build now produces jars with sources.

Original comment by szcze...@gmail.com on 14 May 2009 at 9:32

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 9 Jun 2009 at 3:15

GoogleCodeExporter commented 9 years ago
Reopened as the rc1 was not release with -sources.jar

Original comment by szcze...@gmail.com on 11 Jun 2009 at 8:57

GoogleCodeExporter commented 9 years ago
fixed in rc2. It is already released and available in maven central.

Original comment by szcze...@gmail.com on 18 Jun 2009 at 11:05

GoogleCodeExporter commented 9 years ago
It's good that the source JARs exist now, but there are some things that could 
still 
be improved:

- mockito-core-1.8.0-rc2-sources.jar contains also the sources for hamcrest and 
objenesis, even though their .class files are not in the binary JAR. It should 
be the 
responsibility of the external hamcrest and objenesis artifacts to have those 
sources.

- mockito-all-1.8.0-rc2-sources.jar does NOT contain the sources for hamcrest 
and 
objenesis. Did the -core and -all source artifacts get mixed up?

- The binary JARs for rc2 appear to still contain also the .java files, which 
makes 
them larger than is necessary. It's enough for the binary JARs to contain only 
the 
.class files.

- The -core sources JAR contains also the .class files for hamcrest. The source 
JARs 
should contain only the source code.

Original comment by esko.luo...@gmail.com on 19 Jun 2009 at 5:24

GoogleCodeExporter commented 9 years ago
That's a great feedback. Thanks a lot for your diligence! I'm on it.

Original comment by szcze...@gmail.com on 19 Jun 2009 at 7:57

GoogleCodeExporter commented 9 years ago
I like the fact sources are packed with binary, as some IDE handles it well. I 
also 
don't think it adds that much to the size of the binary.

We'll fix the sources jars for maven.

Original comment by iczechowski@gmail.com on 19 Jun 2009 at 11:54

GoogleCodeExporter commented 9 years ago
mockito-core JAR with sources and binaries takes 1189 KB. The same JAR with 
only 
binaries takes 629 KB. So sources make it 90% larger.

Since Mockito is not usually distributed with other programs, it's only a test 
time 
dependency, the size does not matter too much.

Original comment by esko.luo...@gmail.com on 19 Jun 2009 at 6:20

GoogleCodeExporter commented 9 years ago
It's a very good point about the size of the jar. On the other hand, the fact 
that
sources are inside makes it totally painless to start browsing source 
code/javadocs
in most decent IDEs. This means increased chance for users getting information
quicker and potential contributors debugging framework code with useful
feedback/patches/etc. Also, as you pointed out, mockito is not distributed with 
the
program hence larger size becomes the a reasonable trade-off.

Original comment by szcze...@gmail.com on 19 Jun 2009 at 9:36

GoogleCodeExporter commented 9 years ago
Hmmm, most Esko points should be fixed before the final 1.8

Original comment by szcze...@gmail.com on 9 Jul 2009 at 12:46

GoogleCodeExporter commented 9 years ago
Oh right. Everything seems to be in order now.

Thanks Esko for testing the jars & raising this issue!

Thanks Igor for the fix!

Original comment by szcze...@gmail.com on 20 Jul 2009 at 7:08