How to install a maven build project? - java

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

Related

Java Maven -> quickls add folder of jars as depencency

my Java Project uses a "/libs" folder containing ~100 .jar files. Almost all of them are not in an official maven repository.
1.) In the moment I manually added to whole folder to the classpath with my Eclipse IDE. That enables to compile and run the App using the Eclipse IDE. But if I want to maven to compile and create jar-with-dependencies, maven of course does not know about the "/libs" folder.
2.) I know that I can add a jar file to my local maven repo with mvn install:install-file but this would take a very long time because I would also have to open every jar and find the whole package name to insert as '-DgroupId' and the Name of the Main Class to add as '-DartifactId'
3.) My Questions:
3.1) Is there an easy way to let maven just include all jars in a folder like I did with my Eclipse IDE? I know that would break the principle of maven that every jar is identified with group and artifact id, but it would be a quick solution.
3.2) If it is not possible to add a folder with jars as a dependency in maven, is there a faster way to add a jar file into a local repo. It would be easier if there is a maven command where groupId and artifactId are automatically discovered by the jar that I do not have to open every jar file and find the Main Class and its classpath
Quick answer: No.
In the past, I have written a script for that because there is not support in Maven for this.

Jave Maven project, how to add so many dependency jars in the third party's lib folder to the maven repository?

I am new to maven java projects. I have a maven java project, and a local repository for the dependency jars. I manually installed the jar by the command mvn deploy:.... whenever a dependency is needed. However now, I have a SDK provided by a third party vendor, it has a lib folder with more than 30 jars inside, in this case, how do I install all these 30 jars into Maven repository manually, and I have to make up the group-id and artifacts for each individual jar, and run the mvn deploy command one by one. Am I missing anything here? I thought Maven is supposed to make the project management easier. In this case, what are my options?
Install the jars in the lib to the repository one by one?
Convert my project back to regular java project, so that I can just copy the entire lib folder.
Any thoughts and help are highly appreciated!
Best
newMavenUser

Build the pom file to download the dependencies with eclipse

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.

Maven: antrun plugin builds JAR file -> How can i install/deploy it in my repository?

I am in the middle of an Ant -> Maven migration project and I have a question (I'm not really a Maven expert), since I'm stuck at a particular point:
Within one of my pom.xml files I have to use the maven-antrun-plugin to call an external ANT file, which builds a jar file and puts it in a temporary folder. There is no alternative to this call. Everything is working fine - the ant script works as it should, but how can I "package" this jar in the usual Maven workflow?
I know that I could manually call the mvn install:install-file, but isn't there a possibility to configure my pom.xml in a way that the above generated jar file IS actually the artifact of that pom.xml?
you use the build helper maven plugin's attach artifact goal to attach your extra *.jar to the maven module that triggered its creation.
since having a single maven module produce more than one artifact is generally a bad idea it would be best if you isolate this in a maven module of type pom so that this would be its only artifact

How to have tomcat use folder with extension .jar as jar files?

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

Categories