dchesterman / ivyidea

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

Feature Request: Automatically attach sources/javadoc to dependencies if available #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a similar feature to IvyDE for Eclipse. Regardless of the 
configurations set up in the ivy file, IvyDE will automatically download and 
attach sources/javadoc to the classes jar file if they are available in the 
repository. This would save a lot of time going to all of the jars and clicking 
the "Attach sources from Ivy repository" link.

Original issue reported on code.google.com by viper2...@gmail.com on 24 Jan 2012 at 5:29

GoogleCodeExporter commented 9 years ago
IvyIDEA will already do this automatically. The detection is based on the 
artifact type and can be configured on the IvyIDEA configuration screen, 
perhaps your sources/javadocs type aren't configured there?

Original comment by maarten....@gmail.com on 26 Jan 2012 at 11:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It could very likely be me but I am not sure how. I really haven't changed 
anything from the default settings so I would figure it would automatically 
work but it is not. I ran a simple test. I took one dependency, joda-time, a 
library I know to have sources working and cleared it from my ivy cache. I then 
went and resolved the dependencies using IvyIDEA and it only downloaded the jar 
in the cache. The source jar was not downloaded. Here are the ivy file, 
settings file, and IvyIDEA artifact types I have configured.

Ivy File
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info organisation="com.example" module="exampleivy" status="integration">
    </info>
    <configurations>
        <conf name="compile"/>
    </configurations>
    <dependencies>
        <dependency org="joda-time" name="joda-time" rev="2.0" conf="compile->default"/>
    </dependencies>
</ivy-module>

Ivy Settings file
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
    <settings defaultResolver="main"/>
    <resolvers>
        <ibiblio name="maven-central" m2compatible="true"/>
        <ibiblio name="java.net" m2compatible="true" root="http://download.java.net/maven/2/"/>
        <chain name="main" dual="true">
            <resolver ref="maven-central"/>
            <resolver ref="java.net"/>
        </chain>
    </resolvers>
</ivysettings>

IvyIDEA settings:
jar, mar, sar, war, ear, ejb, bundle, test-jar

source, src, sources, srcs

javadoc, doc, docs, apidoc, apidocs, documentation, documents

Original comment by viper2...@gmail.com on 28 Jan 2012 at 3:12

GoogleCodeExporter commented 9 years ago
For maven modules, Ivy will put the sources jar in the 'sources' configuration, 
so if you want IvyIDEA to attach the sources, you have to tell Ivy to download 
the sources configuration as well:

<dependency org="joda-time" name="joda-time" rev="2.0" 
conf="compile->default,sources"/>

Original comment by maarten....@gmail.com on 28 Jan 2012 at 6:33

GoogleCodeExporter commented 9 years ago
Thanks for the reply. I had a feeling you were going to mention this. :-) Your 
explanation is why I posted the issue. The IvyDE plugin for Eclipse handles 
this slightly differently. It will download and attach the sources of the jars 
regardless of the configuration/scope you have provided in your file. They make 
the assumption that since you are inside of the IDE it would make sense to have 
the sources attached.

Original comment by viper2...@gmail.com on 30 Jan 2012 at 4:39

GoogleCodeExporter commented 9 years ago
ok, I'll reopen the issue

Original comment by maarten....@gmail.com on 1 Feb 2012 at 11:49

GoogleCodeExporter commented 9 years ago
Thanks for hearing me out. Much appreciated.

Original comment by viper2...@gmail.com on 2 Feb 2012 at 2:53

GoogleCodeExporter commented 9 years ago
The eclipse plugin also seems to automatically download the sources/javadocs 
for transitive dependencies. duplicating that behavior for ivyidea would be 
great.

Original comment by JamesK...@gmail.com on 28 Mar 2013 at 5:02

GoogleCodeExporter commented 9 years ago
Here's a patch I did a while ago that retrieves sources/javadocs even if they 
aren't selected by an Ivy configuration. It's based on what IvyDE does. Hope it 
helps. 

Original comment by bene.nz on 12 Apr 2013 at 5:05

Attachments:

GoogleCodeExporter commented 9 years ago
Is this issue fix?

Original comment by plv....@gmail.com on 17 Jun 2013 at 5:11

GoogleCodeExporter commented 9 years ago
The fix provided works for me.

Original comment by nat...@gmail.com on 17 Jun 2013 at 6:20

GoogleCodeExporter commented 9 years ago
The patch worked for me as well.

Original comment by sbhus...@etsy.com on 5 Sep 2013 at 2:43

GoogleCodeExporter commented 9 years ago
Using <ivy:resolve type="source"/> all sources are downloaded to the cache. 
Just need to add them in the library settings as the jars.

Original comment by a...@burmeister-teltow.de on 15 Oct 2013 at 12:06

GoogleCodeExporter commented 9 years ago
To the maintainer: I've been using custom builds of the plugin with this patch 
for the past few months so that all sources are available. There haven't been 
any problems.

When can we have this in a release? Thank you :)

Original comment by shik...@schmizz.net on 27 Jan 2014 at 5:15

GoogleCodeExporter commented 9 years ago
Thanks for pinging me about this issue.
I was unaware there was a patch available.
I'll try to take a look at it.
Is it still valid against latest SVN trunk?

Original comment by maarten....@gmail.com on 29 Jan 2014 at 9:37

GoogleCodeExporter commented 9 years ago

Original comment by maarten....@gmail.com on 29 Jan 2014 at 9:38

GoogleCodeExporter commented 9 years ago
Yes, it is still valid and applies cleanly

Original comment by shik...@schmizz.net on 30 Jan 2014 at 5:37

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r279.

Original comment by maarten....@gmail.com on 12 Feb 2014 at 10:05

GoogleCodeExporter commented 9 years ago
I've applied the patch. I've also made this behaviour configurable in the 
IvyIDEA settings (enabled by default). It would be great if someone could give 
it a try before I publish a new release.

Original comment by maarten....@gmail.com on 12 Feb 2014 at 10:06

GoogleCodeExporter commented 9 years ago
works for me! thanks, looking forward to the release

Original comment by shik...@schmizz.net on 13 Feb 2014 at 8:00

GoogleCodeExporter commented 9 years ago
Seems good for me.

Original comment by viper2...@gmail.com on 21 Feb 2014 at 3:05