In Netbeans, I can right click on a dependeny, and select "Manually install artifact", and it will run a maven install command like the one below:
mvn install:install-file -Dfile=AppMeasurement_SE.jar -DgroupId=com.omniture -DartifactId=AppMeasurement_SE -Dversion=1.2.4 -Dpackaging=jar
Does Intellij have a similar feature, or should I learn to love the Linux command line prompt?
There is plugin intellij-maven for this.
"intellij-maven" is a maven project which can be used to create all of
IntelliJ IDEA (Community version) build artifacts with maven and to
install them into local maven repository.
Related
I am using Red Hat JBoss Developer Studio Version: 11.3.0.GA. I have imported a existing Java Maven API project into my workspace. I have also configured Maven 3.5.3 and setting.xml to my studio.
I am trying to run below mvn cmd from my studio on my imported java api maven project.
mvn clean package -Dmaven.test.skip=true -pl project-Sample-name -am -Dglobal.version=${BUILD_NUMBER}
Q1) How to configure and run the above cmd from my Studio.
I right clicked on parent pom.xml ->Run As->Maven Build->Edit Configuration and Launch screen opens. I dont know how to proceed further after this. Please advice.
clean and package will be in Goals on the Main tab
system properties such as maven.test.skip=true can be defined on JRE tab in VM arguments
There is no need to specify -pl project-Sample-name -am when you have all required projects imported in Red Hat Developer Studio
I am facing a strange issue with Netbeans 8.2
I have installed a jar using command line mvn install:install-file -Dfile=wlclient.jar -DgroupId=com.oracle.weblogic -DartifactId=wlclient -Dversion=12.1.3.0 -Dpackaging=jar
In the project I have the dependency
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>wlclient</artifactId>
<version>12.1.3.0</version>
</dependency>
The projects builds fine with mvn clean install in my console
When I am executing from Netbeans "clean and build" I can see that in the output it executes cd /<path to project>/; JAVA_HOME=/<path to java>/jdk1.8.0_181 M2_HOME=/opt/apache-maven-3.5.3 /opt/apache-maven-3.5.3/bin/mvn clean install but it fails with message "class file for weblogic.i18n.logging.MessageLoggerRegistryListener not found" which indicates that it cannot find the installed jar above.
Any ideas why this is happening?
ps. I am using CentOS Linux 7 and Oracle JDK
Thanks
NetBeans uses an embedded Maven as default which has it's own repository, settings, etc.
Did you switch it to use the same one you use from the command line?
I'm working with multiple projects in Eclipse. because I want to automate the building I want to script the building process.
Unfortunately I cannot do the same actions on the commandline as in Eclipse.
So a common problem is that when a new function from a referenced project is used, I cannot build the project on the commandline with mvn. I use the command:
mvn clean install -U
But this command will give a build failure until I do a Eclipse Maven Update from the eclipse GUI. After that I can build the project again.
I also tried all the other commands I came across Stackoverflow:
mvn eclipse:eclipse
mvn dependency:resolve
So I just want to that Maven Update command in eclipse from the commandline so I can build from the commandline. If anyone could tell me what I'm doing wrong that would be awesome.
Thx in advance
Update for more clarification:
The project structure is:
Rest-service, Framework-service, Framework-model
Framework-model is referenced in the pom file by Framework-service and Framework-service is referenced by Rest-service. The other projects are not relevant to the problem.
When a function is added to Framework-model and used in Rest-service it gives an compilation error in eclipse and when I build with mvn clean install -U, although Maven install in eclipse is succesful but I think it is still using the old compiled code. After a Maven Update command in eclipse the compilation error is gone. And mvn clean install -U from the commandline also works.
How could I do a Maven Update command in the commandline? If mvn clean install -U should also do a Maven Update command, what settings should I check?
Another update: So this weekend I tried different things and running mvn compile before the mvn clean install -U command gives a different output. And finds the new function. But as I read maven, I thought install should also do the previous steps. How is this possible?
Eclipse's Maven plugin uses the maven version configured in Preferences/Maven/User settings. If you have a different version of maven in your Eclipse's settings than the one on your PATH variable, you could have different outputs. Maybe try and check that.
I am trying to execute a sample application from here: http://www.ixtendo.com/secure-your-jsf-application-with-jaas/#comment-3792. The author says:
To build the project, you have to install Maven and call mvn clean package.
I have installed Maven in my Ubuntu 12.04. But I am new to Maven and don't know how to build the project with it. Could someone please explain in detail how to build the project with Maven?
The command mvn clean will work only if you are executing the command from the context of the application where pom.xml is located.
here is a quick tutorial for Maven.
I have the m2Eclipse plugin from Sonatype installed in my IDE. It allows me to run various maven commands (package, install, etc.) by right-clicking on a pom.xml file and navigating to the "Run As" menu.
However, I haven't figuered out how to the equivalent of mvn eclipse:eclipse from within the IDE, is this possible?
Thanks,
Don
Yup, when you right-click over the project, in the Maven sub-menu, you have an Update Project Configuration command which does precisely that.
alt text http://scott.phillips.name/wp-content/uploads/2010/01/Maven-Context_Menu.png