Netbeans ignores jars installed in .m2 - java

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?

Related

lombok constant need to mvn install

I have a java spring boot project that uses Lombok. I love this library as it reduces code.
I have a problem here. That every time I switch on my spring-tool-suite project, I need to do:
mvn clean
mvn install
mvn update
to resolve get set dependency compilation errors.
Configure your IDE with lombok.
1.execute lombok.jar and configure IDE
2.Restart IDE
a)if IDE not working after configuration
1)goto IDE installation HOME folder and open STS.ini file add -vmargs
-javaagent:lombok.jar this two line code ther.
Note:-keep your lombok.jar in IDE installation folder also

Want to build project with commandline mvn but have to use Maven update in eclipse first

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.

How to build ascidoc PDF in IntelliJ with Maven on Ubuntu Linux

My system setup is the following:
IntelliJ 2017.2
Maven 3.5.2
Java 7
Ubuntu 17.10
I have a project in IntelliJ where I want to use asciidoctor variant of asciidocs. I have created a adoc file, and now I want to create the PDF from that file.
I have tried:
mvn clean install -Pbuild-release-notes
But I cant find any PDF file.
Have a look at the POM File (pom.xml) in this asciidoctor-pdf-example project.
When you run:
mvn clean process-resources
(the maven command depends from the asciidoctor-maven-plugin configuration in the POM File)
You can run maven from the command line or from an IDE, you will get your PDF in target/generated-docs.

How Do I Run "mvn install:install-file" in Intellij

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.

How to run the downloaded project through eclipse

I am referring "http://krams915.blogspot.in/2011/01/spring-mvc-3-hibernate-annotations.html" blog and at end of the blog there is source code in zip folder i have downloaded but i dont know how to run in Eclipse,
at the last on blog they have mention
You can run the project directly using an embedded server via Maven.
For Tomcat: mvn tomcat:run
For Jetty: mvn jetty:run
I dont know how use this steps.please help me how to run this project,
I am using tomcat as my server,
Thanks,
Basically you need to do two things:
Install maven plugin in eclipse.
Add a tomcat server instance in eclipse.
This link should guide you to achieve that:
http://www.mulesoft.com/tomcat-maven
Install Maven
go through command line to your project folder
call mvn tomcat:run or mvn jetty:run
1.Install Maven
2.set system enivorment
3.go through command line to your project folder(where the pom.xml is)
4.call mvn tomcat:run or mvn jetty:run
Download Spring Source Tool suite which comes along with maven. It maked things little easier for you. You can directly run maven projects from the IDE itself.

Categories

Resources