javadoc:aggregate deletes product target folder - eclipse-rcp

I can "mvn clean install" to generate zip file of my multi-project application in target folder of my product project. I can run "mvn clean javadoc:aggregate" to generate javadocs.
no problem up to generating both...
When I run "mvn clean install javadoc:aggregate" javadoc is created but product zip is created and deleted.
I have tried to run mvn again but:
"mvn clean install" generates product but deletes my javadoc target folder
"mvn clean javadoc:aggregate" generates javadocs but deletes my product target folder.
What could be the reason? Any workaround?

This is a bug in eclipse-repository that has shown up repeatedly on mailing lists etc. but there is no bug report for this yet. If you have a small, standalone example project to reproduce the problem, please file a bug report and attach the project.

Related

delete all the package imports from the all the .java from the project in eclipse

I am new to automation scripting, below is a problem I have faced
All the package imports are deleted from every .java file in the project in the eclipse including in the framework as well which gives an error while running the application as mvn test in the cmd prompt.
is there any way we can delete all the imports(not just the unused package, including the packages used) from all the java source code.
I am using the Maven build tool and Junit, I have deleted the project and rebuild. I am unable to recreate. please suggest

Maven dependency Hibernate library cannot be read

I'm getting the following error in eclipse.
Archive for required library: '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' in project
I've done Maven->Update Project and still it can't recognize the library.
I've verified that the jar file exists in the location mentioned.
This post has the same error as I do but I double checked my pom and there are no duplicates.
Check access settings for file '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' if you are using *nix system,
Also make sure you can open hibernate-core-4.2.1.Final.jar archive using third party tools e.g. 7zip or winrar. from my experience many times maven in eclipse does not properly download dependency and downloaded jar is corrupted. If that is the case you can manually download this jar and replace it in .m2 repository.
Try to run maven task eclipse:eclipse from command prompt
open command prompt, Change Directory to project root directory and type
mvn eclipse:eclipse
And go back to eclipse and refresh project and see will it works :)

Can't run Unit tests from eclipse

If I create a test class I can't run it from eclipse until I have run it via maven on the command line first. My project build path output folder is pointing to project/target/classes. And build automatically is checked in the eclipse.
Anyone know why eclipse doesn't create the classes automatically?
Here's how the layout and build path of your project should look like.
Layout
Build path
In addition to what Marcel said, someone who runs into the same problem should look for dependencies between projects within Eclipse.
I was working with project A, which depended on project B. Project A was built and run normally, except for the problem mentioned in this post (run a JUnit class test). After digging for a while, I noticed that Project B had a build error (a source folder went missing, who knows why) and Eclipse was not building the project B, which caused an error on project A.
As soon as I fixed the project B build error, the problem with JUnit class was solved.

TestNG test cases not auto compiling in Eclipse

I have a Maven project imported as General --> existing workspace into my eclipse.
When i write a new test file or edit an existing test file, the file does not seem to auto build. My build path is correct and the test out put folder is in \target\test-classes
any help here?

Maven integration into eclipse, Problems with Dependencies vs. Referenced Libraries

he fellas, i need your help again.
Im trying to develop a new part for an existing software. The parts are all done using Maven. I have to work in several projects at once, which are all continously opened in Eclipse. In Eclipse i use M2E, but i tend to edit the poms directly in xml.
So, now I can build (clean install) the projects individually, works ok. But Eclipse now has problems with the online help: It shows me errors. Eclipse cant seem to see classes which are placed in the same project, but different packages. Note that it works fine when i compile it!
Also after I run the pom the dependencies dont show up as "Maven Dependencies" but as "Referenced Libraries".
This persists after I run mvn eclipse:eclipse from outside and refresh.
Thanks so much for your help!
"Do not ever do mvn eclipse:eclipse", only do mvn eclipse:clean from command line first and then import "as maven projects" using your eclipse M2E plugin.
M2E Plugin knows how to handle Maven Dependencies, whereas mvn eclipse:eclipse knows how to handle Referenced Libraries, and they are NOT compatible with each other. You can always do mvn update project in Eclipse after mvn eclipse:clean.
I had to delete the maven-project, too, after using eclipse:eclipse. It added the references as "Referenced Libraries".
Manually deleting the .project and .settings files in the project folder and importing the project again helped. I used the M2E import. Afterwards it displayed the libraries within the "Maven Dependencies". Subsequently I was able to run it on my local webserver.
I do not really know the reason for the behavior, but deleting the project and reimporting it solved it.
I agree with kisna. As an alternative to fix the project if already contains both "Referenced Libraries" and "Maven Dependencies", you can do the following:
https://docs.oracle.com/cd/E14545_01/help/oracle.eclipse.tools.weblogic.doc/html/j2eelib/operations/opRemoveLibRefFromClasspath.html
Right-click on the project and select Properties -> Java Build Path -> Libraries tab -> Find the entry in the list of libraries called Shared Library [] or/and all libraries that starts with 'M2_REPO/', and then select it/them and remove.