I am running NetBean 7.4 on Mac and I am sort of new to Maven dependancies.
I have been given a project that uses Maven to download a framework for networking simulation.
Turned out that the framework has a bug and the teacher gave us a public GitHub repository with all the source code for the framework, so that we can also modify it.
How do I connect the GitHub link (with sources) to NetBeans in order to being able to modify the framework classes? The "Attach Sources..." button that appears on the framework classes asks for a JAR or ZIP (if I download the ZIP from GitHub it doesn't work).
Moreover, it looks like the framework files in the Dependancies folder cannot be modified anyway (read-only files).
Thank you all.
to "connect" 2 different projects, the checked out source's version needs to be equal to the version in maven pom.xml.
So clone the github repository, figure out which branch/tag matches the version in your project and check it out. Then open the project(s). If you did that correctly (and assuming the github project is actually maven), your project's dependencies section will list them with project-like icon. Then the projects are linked.
Related
I am new to Java and trying to import an API from GitHub, to use its functions in my project. API is on GitHub as Java files, but the only documentation I can find on the web is for Jar files.
I just need to access these functions in my code in Eclipse---what do I do?
Thanks!
Your various options include:
Figure out if the jars exist in a maven repository. Typically the project will mention that in their documentation. If so, you can use a package manager like maven or gradle to download that jar into your project.
If the project does not have jars in a public repository, check the Releases tab in github. It may have jars that the project owners have built.
If those are also not there, clone the repo and build the code into a jar yourself. The project would likely have build scripts committed or otherwise docs for how to build it.
I need to write some Unit-Tests for google guava 15 (for an online course).
There is a semi-automatic tool involved that reads the source code and executes it with the help of eclipse. So I need readable source code (not only the binary classes) that can be run from within an unittest.
So here is what I did:
cloned github repo via egit
Import from git -> local repository -> general project (I tryed new java project and the new project wizard but that created empty folders, only with general project the source was at least visible within eclipse)
went back in git history to guava version 15
But it seems that he doesn't build the java project now (of course because its a general project). I found some answers to this topic: editing the .project from eclipse to change the general to a java project but that did not work, maybe I did it wrong).
But is there an easy way to do this? Maybe by using a build tool or something? Seems to be very complicated to edit the .project for a complex project like guava, only telling him that this is a java project does not work!?
Guava is designed to be built using the Maven build tool.
If you want to do this within Eclipse, the M2E plugin implements Maven integration. It knows how to import a Maven source tree as an Eclipse Java project, including setting up the ".project" file and other stuff that Eclipse needs.
Here's how to install it: Maven in Eclipse: step by step installation
This is somewhat detailed answer on how to get a Maven project in Eclipse working and manage it by EGit. It describes almost the same situation.
We have a core set of java libraries, published as jar files, that are used in multiple client projects. Both the library projects and the client projects are on our git server (GitLab EE). Sometimes clients and third-parties (such as sub-contractors) have access to the project source code, but we don't want them to have access to the source for the core java libraries.
So what I need to know is how to set up some kind of dependency or similar in git so that we can automatically pull in the latest version of the library file? I've been looking at git submodule, but that looks like it will pull in, or at least give access to, the full source of the library projects. I've also started looking at Maven, but I'm unclear whether that also needs access to the whole repository. Is there another/better way to do it? Or will Maven actually do what I want? Or do I need to publish my jar files somewhere else, and if so how can I automate that process, as I don't want to have to manually copy the jar file somewhere every time it's updated (which is often)?
Maven and a binary repository like Nexus is the common way to do what you're asking. Nexus stores binary files like .jar's .dll's etc and Maven has the capability to publish and retrieve specific versions of these binaries and include them when building the project. As Ryan commented, Maven Central is a public binary repository that you could publish to if you wanted the whole world access to your .jars, but with Nexus you have fine grained access control over your binaries.
If you build your own projects with Maven, you can configure it to build, test, and publish right to your Nexus repository with a single command mvn deploy. Then clients just have to update their project to point to the new version and Maven will download it and use it on the classpath. It's all very seamless, and I would definitely recommend refactoring your build process to use Maven or a similar product.
I'm helping develop a software product using Java (Eclipse Kepler for RCP Developers is our IDE) that is made up of dozens of plug-ins. We store all of these in an SVN repo on Sourceforge.
We have just been told that due to a legal problem, one of the plugins cannot be accessed via a SVN repo.
I moved it to GitHub and then imported it into my workspace, but am now unable to get the project to build in Maven. I receive this error:
Child module /x/x/x/github.project of /x/x/x/project.build/pom.xml does not exist.
The pom.xml file of project.build contains this line
<module>../../github.project</module>
Which should still be correct.
The pom.xml of the plugin project has not been modified, so it still shares the same group ID as the other plugin and all of the parent information is correct.
Can anyone give me some advice on how to properly integrate this plug-in? Is there a way to "require" a GitHub project in SVN or a different way to ensure it's included?
Thanks.
I am using play 1.2.4 to create a web app. It works together with some other applications which are maven projects: they are compiled and resolved (dependencies) with maven.
Now I need to modify my play app so it can also be compiled and started with maven.
Therefore I download maven (3.0.4), installed the maven modul and did everything according to https://github.com/wangyizhuo/play-maven and http://www.playframework.org/modules/maven-head/home
I manage to automatically create a pom file in my project. The problem is that the jars from the play framework are not copied into the lib-folder and when I try to execute mvn package they are missing.
Is there a way to get the maven module to work properly? If not, is there another possibility to compile and start the project from maven (i.e. intermediate ant-file that can be executed by maven?)
Many thanks in advance!
This explains it pretty well. I havnt looked at the module you are refering too, but this shows you how you can create tasks and inculde directories in your build.
Do you need to use maven to build/run it? If not it looks like there is a community contributed extension that allows you to use maven from within play.