Include local jar into maven - maven-plugin

My application is having 70 jars with ant application. Now we are moving ant to maven, but i am unable not find 10 jars (Local jars) in maven repository.
Shell we import 10 jars manually.(I read somewhere that if you include more jars manullay don't choose maven, is it correct?)

Yes, to use Maven, jars must be fetched from $HOME/.m2 local repository. If those missing 10 jars are individual maven projects with a pom.xml & you had run maven install in each one of their project folder, i see no reason why those jars are not there in your local repo.

Related

How to deploy DocDokuPLM project on JBoss Wildfly10?

I have cloned the docdoku-plm from this repository https://github.com/docdoku/docdoku-plm/tree/dev
I build this project but i don't know what i have to deploy in my server , i checked in pom.xml and they have given packaging as pom
After i build the project no target file is created.
I want help how can i deploy this project in my wildfly 10 server.This is the structure of the project and after bulid there is no target file created
First of all when you build your project,one EAR file is generated in eplm module, you need to deploy that EAR file in wildfly.
After this follow this link https://github.com/docdoku/docdoku-plm/wiki/Installation-Guide for configuration according to your server.
In docdoku-plm if you are using eplm project and deploying in glassfish,by default it will take EclipseLink as JPA framework and in WIldfly it is Hibernate So you have to add dependency in pom.xml or change hibernate module to eclipselink.

tomcat8 Maven plugin

Is anyone having idea on status of tomcat8 Maven Plugin. Is it ready for use or not ? I can locate the repository for it here but could not find this plugin on apache site. I tried using it with same configuration as that of tomcat7-maven-plugin but it does not start my application.
Go to following link
https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin/3.0-r1756463
copy paste the dependency tag
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
But still if your pom file shows can't locate repository
click on the download link in above url and download jar file and past it in <your-home-directory>/.m2/repository/org/apache/tomcat/maven/tomcat8-maven-plugin/3.0-r1756463
In your IDE update maven project
tomcat maven plugin is only available for tomcat7, you can try spring boot which has an embedded tomcat8, it also provides other containers, like jetty

How can I update my Flink version programmatically

At the moment I have Flink 0.8.1 installed on my machine. I installed it via Maven and would like to know how I can update it. Do I have to deinstall everything in order to update to the current version? Or can I do it via Maven?
If you have a Maven project which depends on Apache Flink you can simply update the version of the Flink dependencies in your project's pom.xml file. Just run mvn clean compile again and Maven will fetch all required dependencies.
The old dependencies will remain in your local Maven repository (~/.m2/repository/). You can "uninstall" the old Flink dependencies by deleting the corresponding jar files.

why building flink-avro downloads SNAPSHOT flink jars

a question about building flink-avro.
i downloaded the source, and i am able to build complete source.
but when i move to folder
flink/flink-staging/flink-avro
and run command mvn package as i want to compile and run the tests, it starts downloading latest flink SNAPSHOT jars.
whereas, i have built the same jars from source, everything is there in local repo.
why it downloads the same things which are built locally?
You need to use mvn install on the top level module first. This will copy the built jars into your local maven repository located at ~/.m2/respository/. mvn package only builds the jars and put them in folder target (no copying into local maven repo happens).
After that, you can step into flink-avro and build there (either with mvn package or mvn install -- as long as no other module depends on the built jars, mvn package is fine). If you change something in a module A and another module B depend on A, you need to do mvn install in module A. Otherwise, module B cannot access the newly built jars from A.
Maven always looks for dependent jars in your local m2-repository first. If it does not find the jars there, it starts downloading them from the Internet. If it finds "old" jars in your local repo, it might still use them (depending on your specified maven update interval). On the other hand, even if you built mvn install locally, and a newer version is available online, maven might download the newer version.
Last but not least, sometime maven does not resolve the timestamp dependencies correctly or does not update the local repo even if you do a mvn install. Clearing the local maven repository (just do a rm for the corresponding jars or the whole repo) can resolve this problem.

How to convert maven project to web application project?

I want to convert a maven project to a web application project, which should contain web.xml. I am using eclipse juno 4.2 with m2e (maven integration for eclipse) plugin software.
Any reply would be appreciated.
Install m2e-wtp
In your pom.xml, change or add the war packaging
right-click on project > Maven > Update project
m2e-wtp will create the src/main/webapp folder and add the Dynamic Web project Facet¤
manually add a WEB-INF folder under src/main/webapp
right-click on project > Java EE Tools > Generate Deployment Descriptor stub
It will create a web.xml under src/main/webapp/WEB-INF/
¤ By default, the web facet is set to 2.5. You should update it, if needed, under project properties > Project Facets BEFORE generating the web.xml
I assume your current project is a maven project which produces jar. Please confirm.
I have not come across any utility which can convert a jar project to a war project.
You have following two options -
Simple open the pom.xml and change jar to war. Create folder webapp under src/main and create a web.xml
Create a new web app project via maven command line choosing webapp archetype or via eclipse choosing maven webapp achetype. Define dependency to your jar project.
If you can provide more information based on my suggestion then probably I can help.

Resources