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

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

Closed
GoogleCodeExporter opened this Issue Dec 16, 2015 · 21 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

  • Changed state: Invalid
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

ok, I'll reopen the issue

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

  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

Thanks for hearing me out. Much appreciated.

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

Is this issue fix?

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

The fix provided works for me.

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

The patch worked for me as well.

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

Yes, it is still valid and applies cleanly

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

This issue was closed by revision r279.

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

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

works for me! thanks, looking forward to the release

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Dec 16, 2015

Seems good for me.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment