I download a j2ee project with a pom file which mention the dependency jar files needed. I want to know to run this pom file and download the jars need for my project? I right click and ran the pom file as maven build. Then it prompt me the Edit and Configuration UI which has the goals and profiles.
What are the values that i need to specify here?
Also is there any special configuration i need to add to eclipse (helios)?
How does the necessary jar files downloaded? Is it from the xsi:schemaLocation location specify in the pom file?
You can use these maven goals for that.
eclipse:eclipse - Download the dependency jars and set them to the classpath(you need to configure your settings.xml in the maven with the maven archiva repo path for maven to download jars from there)
install - build the project and install it in the local repo.
Have a look at this answer for the whole list of goals.
IF you install the Maven to Eclipse integration plugin (m2e), Eclipse will automagically add the project dependencies to the project's build path, and download them in the process.
Related
I'm having a spring based project which does not have any build management tools like maven/gradle. For dependencies I'm adding the jar files to the build path. Some dependencies like aws-java-sdk and others having only pom.xml files in their jar files. These additional dependencies for the jar files are not getting downloaded from maven central repo. Is there any additional configuration need to be done for this?
For dependency resolution, you need a build tool.
The standard tools nowadays are Maven or Gradle.
I have written a series of classes that I want to turn into a company library. Managing all it's dependencies was a pain so I made a Maven project for it to be handled automatically.
I have packaged my library project into a .jar and added it to my local Maven repository. I can now list it in my application project's pom.xml, it get's brought in just like any other dependency and works great.
The problem is the dependencies of my library do not get brought in. It seems like this should be straight forward but trying to copy other packages in the Maven repository doesn't work.
Right now my jar consists of two directories:
com\company\package\Main.class
And:
META-INF\maven\com.company\package\pom.xml
Where do I need to put the pom.xml file for Maven to go get my dependency's dependencies? Is there something else in the .jar build that I am missing?
The Maven POM file (pom.xml), which describes the project/module, is usually placed in the root directory.
The POM file can then be picked up by your Maven installation, which will automatically configure the project, which means also downloading dependencies from their repositories.
For an example of an artifact deployed to a repository, see
http://central.maven.org/maven2/org/springframework/spring-core/5.1.5.RELEASE/
I want to install the following plugin:
https://github.com/AgileReview-Project/AgileReview-EclipsePlugin
Its a maven project. I already successfully build the plugin with maven. Now, I want to install it.
How can I install it? When I build the file with Maven, no Jar file was created that I can use for installation.
pom is container of sub-modules, I see a lot of sub-directories in the project.
Somewhere, nested within the project structure you will find artifacts (modules) with jar packaging. Maven generally builds everything into /target subdirectories of each module. So after mvn install look into target subdirectory in a module with jar packaging.
The link you have (https://github.com/AgileReview-Project/AgileReview-EclipsePlugin) is the actual work code project of the plugin. (It is only interesting for the people working on the plugin or others who want to change/improve it).
According to AgileReview website, you'll have to simply do the old-way plugin installation. All the steps and infos are here
I have a maven module with one pom.xml. I have added some external jars which don't have maven repository as external jars in the project build path. The module is working fine(no errors).
When I am building it using maven build, it says some of package names from external jars are not found. there are many like this. the reason is corresponding packages API (groupid,artifactid) are not part of the pom.xml.
I want to know how to build maven module in such scenarios.
Appreciate any help
Maven does not support using jars that are outside of Maven. You have two choices:
mvn install:install-file
mvn deploy:deploy-file
The first puts the jar in your local repo, the second in your shared repo manager, which you should have.
I have in Eclipse web application project that depends from other projects.
When I run debug on embedded Tomcat in lib folder that Eclipse copied not jars, but folders with names like:
dependent_lib1.jar
dependent_lib2.jar
dependent_lib3.jar
....................
So web application don't start because didn't found some files. When I manually deleted all these folders and manually copy jar files - all works.
Does it possible ask Eclipse (or maven - this is maven project) to copy jars or ask Tomcat use folders like jars?
Thanks.
Here is how I think it should be done with maven:
If the other projects are also maven projects, export them as maven artifacts in your local repository. A nice article is Maven Deploy Plugin - If they are not maven projects you should manually generate the jar files and add them to the repository, some information can be found at Best way to create a maven artifact from existing jar
Add the exported artifacts as dependencies to your project. A lot of details can be found at Introduction to the Dependency Mechanism
Hope this helps.
Eclipse cannot do it as its just an IDE, you would need use A BUILD SCRIPT using ANT(Copy tag should do it) and run it before you start your server.
Check this for more details:
http://www.javabeat.net/tips/103-writing-simple-ant-build-script.html