如何在我的项目中获取源代码

时间:2013-04-30 14:41:36

标签: java intellij-idea

我正在尝试将源添加到我的项目中。我手动添加了下面的回购并包含了大气快照。

<repositories>
    <!-- Added to get the Atmosphere 1.1.0-SNAPSHOT, can be removed when 1.1.0 is released -->
    <repository>
        <id>oss.sonatype.org-snapshot</id>
        <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        <releases><enabled>false</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-runtime</artifactId>
        <version>1.1.0-SNAPSHOT</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

我从here下载.jar但是当我将其添加到我的项目结构中的“库”部分时,它不会将其添加为源,而是将其添加到Classes下。

在查看类的接口时进行调试时,我使用了编辑器顶部的快速“附加源...”选项并导航到.jar,但没有用。

1 个答案:

答案 0 :(得分:0)

Maven找不到源代码,因为Maven存储库中没有该库的源代码(我认为这对库的快照来说很常见)。我下载了其中一个罐子,它们只包含类文件,所以我想知道,即使你手动连接罐子,如何查看源码。