This question already has answers here:
Can Maven collect all the dependent JARs for a project to help with application deployment?
(6 answers)
Closed 7 years ago.
I have a cloud application which uses git and maven, so the source code is uploaded by Eclipse using GIT, and the required libraries are downloaded to the server by maven. But I have one library not in maven, it's downloaded as a source and also run time jar, xxx.jar and xxx-source.jar. When I upload the source, the reference libraries are not uploaded to the server, so the compile will fail on the server.
I could unzip it and package in the source folder and upload altogether. However, is there a simpler way just to put the source.jar as part of the project so Eclipse can upload that jar file as part of the project to the GIT server? and then the server will use that jar for compile?
is it a third party? if so, why you need the sources? you can simply upload it manually to your repository and set it as a dependency in your pom.xml.
if you still need the source for reference, you can upload it with a classifier, like you have (source).
Related
I want to download the .jar file of a java framework.
That .jar should of course contain all the .class files that I need for my project.
I tried downloading from here:
https://mvnrepository.com/artifact/org.apache.camel/camel-core/3.18.2
But the .jar file is only 4KB big and contains only meta information, but no java classes.
I found jar files with java classes in them in older versions, but in newer versions they seem to upload only meta information.
So I don't know how to get to the .jar file with all .class files inside.
I don't want to work with maven or gradle for now.
And you can't just download jars with maven or gradle you have to build your entire project with it.
I also searched the github (https://github.com/apache/camel) and source code of the "Apache Camel" project and did not encounter jar files.
Is there any other popular place where open source java frameworks/libraries with jar files can be found?
The apache camel module doesn't contain any code. It just declares a list of dependencies, in the /META-INF/maven/org.apache.camel/camel-core/pom.xml file:
camel-core-engine
camel-core-languages
camel-bean
camel-browse
camel-cluster
camel-controlbus
camel-dataformat
camel-dataset
camel-direct
camel-directvm
camel-file
camel-health
camel-language
camel-log
camel-mock
camel-ref
camel-rest
camel-saga
camel-scheduler
camel-seda
camel-stub
camel-timer
camel-validator
camel-vm
camel-xpath
camel-xslt
camel-xml-jaxb
camel-xml-jaxp
slf4j-api
You have to download the jars that you need in this list of dependencies. All jars can be found on https://mvnrepository.com/.
This is why everyone will recommend you to use maven or gradle, as those tools will manage the dependencies for you.
This question already has answers here:
Export maven project from eclipse
(2 answers)
Closed 3 years ago.
I have an eclipse workspace with 2 non-web based projects, with over a dozen jars as maven dependencies. How do I transfer this to run on another computer that does not have eclipse? Do I export as a war, jar, or wnat?
As far as I understand your question about copying the projects to another computer, I provide below the followings.
Build the maven project, if it is a web application, copy the .war file which contains all the dependent libraries inside web-inf/lib.
Build the maven project, if it is a non-web application, copy the jar file only. To copy all the dependent jar files, you need to identify. Follow the step 3..
To copy or identify the all the dependent jar files for a project, there is no need to go to .m2 directory and search. Go the project directory and run the maven command mvn dependency:copy-dependencies. You will find all the dependent jar files inside the target folder. If you want, you can copy all the jar files.
If the project is a maven based project, you can directly copy the entire project to another computer and if maven setup is there in that computer, you can still build the project there. You do not need eclipse in that computer.
I would suggest if a project has maven wrapper, while copying the entire project, there is no need to install maven. In that case, go to command prompt for that project and type mvnw clean install or mvnw clean package.
If you want to copy or export the project using eclipse, you can do it like this. Make right click on the project, select export and then select General > Archive File.
I have created a java project using eclipse and in that project I have included a few jar files such as sqljdbc4.jar, jtds-1.2.4.jar, and log4j-1.2.17.jar. I have also included a dll for windows authentication in this project. I'm attempting to export this project as either a .zip .tar etc so the project can later be imported by someone else and work with the project.
I want to export the file in a way that the other developer can import the project and instantly begin working without having to download the jar files that the project is dependent on. Is this possible at all
I have already tried what i have thought would have worked going to export -> Archive file -> save in .zip format. I was unsuccessful with this I also figured going to properties -> Order and Export tab and selecting the needed jars would work and then exporting still unsuccessful.
Once the other developer imports the project the jars are not there for him...
I would use Ant. It is integrated right into eclipse and takes an .xml file called build.xml. It works by specifying "targets" in the xml file that each perform some action such as "build" (i.e. run javac), "deploy" (i.e. run the jar command), etc. There is a command that can be called from within the jar target called zipgroupfileset which you can use to package all of the jars within your main jar file.
More info about ant can be found here
There are many variations on the following but the basic idea is to
use a code library and share the project. The repository
can be local to you or even better put it on an http server
( ala VisualSVN or google or the like ).
1st (local) solution:
Install SVN ( http://subversion.apache.org/ )
Install SubVersion
Create a repo on your local file system
Share the project
Dump the repo
Send the repo
Load the repo (Other developer)
2nd (network) solution (using google code as your library)
Install SVN ( http://subversion.apache.org/ )
Install SubVersion
Put your project on GoogleCode (http://code.google.com/)
Other developer gets project
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
NetBeans - deploying all in one jar
I am using netbeans to develop a project. My project also depends on the javaMail files which I added using Netbeans libraries. When I build the project I get a dist folder under which is my jar file and a lib folder. I want to distribute the project simply to my users and want to some how wrap the lib contents into the project jar file. Is there a simple way to accomplish this using Netbeans?
There are a few posts on this topic:
Put external libraries to the jar (NetBeans specific)
Netbeans - deploying all in one jar (NetBeans specific)
Classpath including JAR within a JAR
Java: Easiest way to merge a release into one jar file
And others specific to other build environments and IDEs
I have installed Red5 server successfully and also am able to run the demos fine. Now, I want to create a sample red5 server application. I created a sample project according to the specific directory structure that Red5 requires. But, now when I try to open this project in Netbeans 6.8, I am unable to because both have a different directory structure. So, Netbeans doesn't consider it as a project. I actually want to convert this project to a war file, so I can deploy it to red5/webapps directory and then red5 deployer service can make project out it automatically. How do I convert this project to a war file? because in Netbeans I am unable to open it. Please help.
I don't know if this will fully answer your questions but this is my configuration.
In the main red5 directory there is a file called project.zip, you can open it to get basic configuration files, directories structure and build files for ant (Pure Java build tool).
Using netbeans, you create a new free-form project and point it to the directory of your project. because of the ant build files the project will be recognized.
Netbeans provides it's own ant version but i prefer to install and use ant from command line.
when you'll run ant in the project directory it will try to find dependencies and probably at first will complain that it cannot find ivy.
Ivy is a dependency manager that red5 project uses that can be found in the following URL: http://ant.apache.org/ivy/download.html
please notice that ant will tell you exactly where it searches for the required jar file, just download the ivy zip, unzip it, and place the jar inside it in the requested directory.
once ant will compile the project properly (just by running the commant ant), it will also create a war file under dist directory.
don't forget to add to your red5 netbeans project the relevant red5 jars in order for the project to compile properly.
I am also prefer use ant from command line. I have two directory structures. One for source files and another for deployment.
This example helped me to start.