maven install command to deploy an artifact to maven repository - java

When i Use option of sts "install or deploy an artifcator in eclipse".it works properly but when i do it manually by using mvn install command and change the version in pom.xml.it deploys artifactory to local repository. but when i refered it in some other project its symbol is different from others.
in above image, OES-ClientCore:24.0.9 is deployed using maven command and i ma refering it in some other project.
and also not working properly.so just tell me the difference of option of sts for "install or deploy an artifcator in eclipse" and manually using command mvn install

mvn install will install the artifact in your local maven repository.
Use mvn deploy to deploy it to a remote repository to share it with other developers and projects
See also:
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

Related

How to stop Maven from installing project build JAR to local repository

I am building a JavaFX project using NetBeans. When I build the project, Maven builds and installs the project JAR to my local repository.
I don't want to install my project to local repository, how do I stop this?
look at Maven default lifecycles, maybe mvn package is a better option

Install Maven artifact from remote repository like npm install

I'm searching for a Maven CLI command to install a Maven artifact (e.g. jar library) from a remote Maven repository. I don't want to manually download the artifact first, so that I can install it. I'm looking for a command like npm install rxjs, which automatically downloads rxjs and installs it as a dependeny to my project.
Is there an equivalent command available for Maven?
Unfortunately, there are no such commands.
One option is through a shell scripts or stream editors (e.g. sed).

Maven3: run plugin as root user

I use IntelliJ Idea for developing, and now i want to use maven project for WAR packaging and deploying to Glassfish4 server. After latest update of OSX (v.10.10.3), glassfish4 must be started from sudouser, so i have a question: How can i pass to maven that this plugin (glassfish:start-domain) must be running from root?
I try to run this command in terminal, but it doesn't help
sudo mvn glassfish:start-domain

Mirror API in Eclipse

I downloaded the glass-java-starter from github and followed all of the instructions on the glass developers site. I got it imported into Eclipse as a Maven existing project as instructed and I changed the oAuth file ID and Secret as specified. When I try to start the project or debug the project I am getting the following exception: Source not found for http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException. The instructions give a command line command for running the project, $ mvn jetty, but nothing for Eclipse. How do I debug this project with Eclipse?
You will need to use one of the maven plugins available for Eclipse to initiate the run:jetty goal.
There are a few available. One of them is Eclipse m2e.
Install the plugin
Create a new run configuration of type Maven Build
Specify a goal of jetty:run
Other solution would be:
set jetty debug port:
export MAVEN_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y'
then run jetty through maven command line
mvn jetty:jetty
After that use Eclipse remote debugger on port 4000.
The war file, product that mvn produce in this sample app is compatible with tomcat or any other standalone server, so just build a war to "webapp" directory of standalone tomcat or jetty or "deploy" directory of standalone JBoss.
Eclipse has plenty of plugins to run those in debug mode.

Is it ok to Install maven if I already have installed maven eclipse plugin?

I have maven eclipse plugin and I want to use a jar file in my project that is not supported in maven so I found out I have to do something like this :
mvn install:install-file -Dfile=c:\kaptcha-2.3.jar -DgroupId=com.google.code
-DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar
So I have to install maven to issue that command but won't that cause redundancy with maven plugin ?
You can install multiple different versions of maven, and configure m2eclipse to use a specific instance, see the setting under Window > Preferences > Maven > Installations.
Managing multiple different versions on the command line is controlled by the PATH environment variable, you would normally define an environment variable M2_HOME which specifies the home directory of the version that you are currently using, and then add $M2_HOME/bin or %M2_HOME%\bin to your path environment variable.
It is no problem if you have both maven and eclipse maven plugin installed. I only use eclipse maven plugin for its pom.xml file editor. I do all other operations about maven through the command line.
Besides, the plugin (m2eclipse) I used, sometimes give strange dependency errors although everything is fine. Because when I run a "mvn install" for the project, it is built successfully. So, I think using maven itself is more reliable.

Categories