0

I want to download the source code for the project XBee-api v9.3 from Maven Central so that I can modify the code for my application. I am using Netbeans and I have managed to produce a POM that validates and compiles successfully. I have then run the command

mvn dependency:resources

from the same directory as the POM to force download of the source code.

I have a few problems: When I look inside the project with Netbeans, I see the class files (which I think may actually be jars). When I open up any class, I only get the method headers, but not the source code.

When I open a class file, there is the option in the top right of the window to "Attach Sources...". When I select "Download", I get a message in the lower left of the window saying "Downloading source jar from known Maven Repositories for local repository file" but nothing seems to be happening.

When I open up the folder either with explorer or Netbeans files view, the folder is empty except for the POM. If I use Projects view in Netbeans, I can see a project structure and what appears to be the generated source files, but no source code.

I can't find answers on Google.

My questions are: What am I doing wrong? How do I download the source code?

Any help would be much appreciated.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                       http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.rapplogic</groupId>
        <artifactId>xbee-api</artifactId>
        <packaging>jar</packaging>
        <version>0.9.3</version>
        <name>${project.groupId}:${project.artifactId}</name>
        <description>A java library for communicating with XBee radios</description>
        <url>https://github.com/andrewrapp/xbee-api/</url>

        <licenses>
            <license>
                <name>GPL license, Version 3.0</name>
                <url>https://www.gnu.org/licenses/gpl-3.0.html</url>
            </license>
        </licenses>

        <developers>
            <developer>
                <name>Andrew Rapp</name>
                <email>andrew.rapp+github.com@gmail.com</email>
            </developer>
        </developers>

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.source>1.6</maven.compiler.source>
            <maven.compiler.target>1.6</maven.compiler.target>
        </properties>
    <!-- https://mvnrepository.com/artifact/com.rapplogic/xbee-api -->

        <dependencies>
            <dependency>
            <groupId>com.rapplogic</groupId>
            <artifactId>xbee-api</artifactId>
            <version>0.9.3</version>
        </dependency>
        </dependencies> 
    </project>
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
dazz
  • 119
  • 2
  • 14

1 Answers1

0

The GitHub project page is here: https://github.com/andrewrapp/xbee-api (referenced in the POM under the url element)

...so you can just download the source from the Github page: https://github.com/andrewrapp/xbee-api/archive/master.zip

Catchwa
  • 5,845
  • 4
  • 31
  • 57
  • Hi The Github has an earlier version. The latest version is only on the Maven repository. – dazz Jul 13 '17 at 01:45
  • @dazz If you look at the POM on Github, it is at 0.9.4-SNAPSHOT - which is later than 0.9.3. You can also look through the tags for the previous releases (0.9.4, etc.) – Catchwa Jul 13 '17 at 01:52
  • Great. You're right. I only looked a couple of weeks ago so the author has only recently updated Github. I was able to compile/run the previous Github version but trying to get the Maven Central version running has been a steep learning curve. When I started learning Java a few months ago, I never expected to be hand cutting xml code just so I could try and build the software. – dazz Jul 14 '17 at 02:24