Today I started with Maven in Eclipse. Now I have a little Question. I saw in a video that when you write Code and use a Class of another Dependency for example and go over the "Error" there should be an Option to search for the Class / Dependency in Maven. But this option is not there in my Eclipse (in the "Mouseover" Menu).
Here some Infos: I use Eclipse Mars and m2eclipse for it. Maven is configured right so: Index Updating etc.
But I dont have the option nonethereless.
The option was removed long ago.
You need to search the class through Maven Central.
Related
The case is quite simple, but I still can't solve it:
INFO: All 'projects' I am talking about are Maven projects.
I have certain Java project that I am working on right now. Recently, I have written a lot of general-purpose code in this project. I also have an 'utils' project with some Java utils in it, so I decided to move the general-purpose code from my main project (let's call it 'A') to the utils project. This would be practical because:
I have less clutter in A
I can reuse the code in other projects without bringing the unrelated content of 'A' in scope.
The problem is that utils is, of course, an utility project, a library if you want. And it does not have a main class. When I try to install (mvn install) it, no sources are included because there is no proper entry point.
So, after trying a lot of things, I have the concern that I am approaching this problem completely wrong and that's why I came here. I do not have any experience with Maven except the simple use case (e.g. including external libraries from Maven Central). Therefore my question is:
Which steps are required to make my utils library available in project 'A'?
I am not aiming to install my project on Maven Central or any other remote repository. I just want it available in my local mvnrepo. I am aware that this means that I'll have to clone my utils project and install it everywhere where I try to use project 'A'.
EDIT 1: I am using Java 11 (openjdk11), Maven 3.6.0, IntelliJ IDEA Ultimate with Maven Helper plugin and also GitHub in order to make my projects available anywhere.
Also, I have just checked that project 'A' correctly includes the jar from the utils project and actually adds it to the classpath (but the jar is empty). So, the problem really seems to be in the utils project.
A maven install would place your compiled code in the local maven repository (.m2/repository).
Sources are packaged by the source plugin.
mvn source:jar
This is related to my last question
One of the answers suggested that the error wasn't related to the AWS plugin but rather Maven. I used this as a reference to install the Maven plugin. The installation finished fine.
I made a simple Java project called Maven with a single class that outputs "Hello Maven". I then tried to configure the java project into a Maven project by going to configure -> convert to Maven Project. These are my settings for configuring my simple project into a Maven project(all default)
After clicking finish, I get into an endless loop. I've tried restarting Eclipse but that didn't work. This tells me that the issue in my other question was related to Maven. I'am new to Maven. Can someone guide me into the next step for debugging this issue? There's no error output I can look at.
I am sorry i don't know maven good enough for the complex environment i am currently working in (1k+ applications, most of them are Java EE). I still give it a try to describe what i want to archive:
0.) There is a company framework that abstracts the Java EE World a bit and is used in all the Java EE components
1.) I checked out the maven project of the Java EE component i am working with
during the build it downloads the dependencys of other components out of the companys repository and stores it inside my local repo for compilation. So i can see the jar-files of the companys framework inside my local repo.
2.) I now want to change some of the frameworks functionality for a local test so i checked out their sources from another SVN repository. I made the changes and build that framework component with maven "clean install".
3.) I rebuild the component i am working with as well.
Inside eclipse i can now click on one of a frameworks classes method and it opens the according source. But this only happens because the local repo is meant to contain source-jars for any dependency as well. So in my editor i can see this source is from the jar of the framework in my local repo and i cant change anything.
Could someone please give me a hint how i can archive the following:
I can make changes to the framework (and build the frameworks jars with "clean install")
I can build my component and it uses the above compiled framework jars rather than the "old" ones from the local repo.
I will right now start to read the entire maven documentation and each and every section (i try to understand that dependency management since 1 year and still don't get it) but i would really appreciate if you could help me out a bit here.
I don't know how Eclipse manages maven dependencies, but
In IntelliJ IDEA this is simple - if maven dependency is in project then IDEA uses it instead of dependency from local repo.
So if u want to edit framework source code and use this changes immidiately - i think that framework should be in your Eclipse Workspace. And your module in Eclipse should reference framework artifacts directly - not over Maven dependency mechanism.
I think that this is a Eclipse Maven plugin responsibility. Do u have any installed Maven plugin for Eclipse? (M2Eclipse for example)
I am new to web prog. and wicket, so i went to below site to run example source codes to play with applications.
http://www.wicket-library.com/wicket-examples/index.html
Simply i create a "dynamic web project" and try to copy source codes to project.
All example's application classes are that type,
public class ...(ex.name).Application extends WicketExampleApplication
On the internet i found some of those examples with classes WebApplication, and i managed to run those examples, like that
public class ...(ex.name).Application extends WebApplication
So my question are;
1-How can i simply run those examples using dynamic web projects?
2-Copying source codes to my project after that how can i call libraries in my project using maven?
I searched many questions but couldnt find any topic who is trying to run those examples simply in a project.
Thanks.
Soso
instead of doing all the messy work just run mvn using tthis
[http://wicket.apache.org/start/quickstart.html]
now just copy the sources
if you any problem and you want to add wicket to an existing project just copy the web..xml , wicket jars and you would have wicket project (i would recomend wicket from another opm connecting you existing services and this way decouple services from the web container ...)
P. S the WebApplication thing they just inehrited it and called ExampleWebApplication
The best you can do is to use maven integration
Install Eclipse (that support Java EE)
Add all required maven related plugins
Version Control: Use Subclipse 1.8.x, see: http://subclipse.tigris.org/update_1.8.x
Maven Integration: m2e , is included in Eclipse Classic. Use
Help->Install New Software, select "--All available sites--" and
choose Collaboration -> m2e - Maven Integration for Eclipse
Subclipse/Maven Integration: Update site: http://subclipse.tigris.org/m2eclipse/1.0/
Then, just checkout the maven examples you got on the web
Go Eclipse--Window-->Show view-->Other
Type svn and select SVN repositories and open it
Then copy the check out address and add it to the svn repositories View
finaly, right click on the link you have added and check out as maven projects.
If you want to create new Maven projects
Create new maven Projects, new-->project-->Maven project
then in new Maven Project Window, in the Filer Text box, Type wicket and select org.apche.wicket as a groupID
After that, you can have your maven codes working well.
If still you got some debug errors, you can open your pom.xml file and add dependencies such as wicket-core and wicket-extensions
I'm having some issues making the maven google app engine plugin work properly.
First of all, I'm not even sure if the archetype I'm using is the correct one, their examples show version 0.7.0 but it seems like never versions exist (i tried 0.9.1 and that works), where can I find a overview of what versions of the plugin is available?
Secondly, the archetype seems.. messy, I don't like the package structure and it doesn't seem to actually include the GAE and GWT dependencies. I have to manually add them to my project in Eclipse, which kind of defeats the purpose of using maven. And how come they are breaking the gwt maven plugin? I know that one includes the actual gwt jars as maven dependencies?
I'm fairly new to Maven, but I have been using the gwt maven plugin for a while, and I'm very happy with everything about it. Is there any way I could just their archetype to do the base project and add the gae plugin to it?
UPDATE
I suspect the problem I'm seeing with the GAE maven plug-in is in regards to undefined properties in the POM. I have no idea if its due to error these aren't set-up or if its due to me actually have to manually set them up. The documentation on this plugin is sparse.
Thanks for the answer below, but I really don't want to add another archetype into play. I think the best solution for me is to try and adapt a GWT maven project manually, to include support for GAE.
I've used the archetype like so :
http://code.google.com/p/gae-mvn-archetype/
to generate a GAE project template.Then manually added my other dependencies. This got me a usable project which I can deploy to GAE and everything.
Also, for Eclipse importing, once the template project was done, I've imported it into eclipse using the m2_eclipse plugin :
http://m2eclipse.sonatype.org/installing-m2eclipse.html
(note that i've imported it into Eclipse as a Maven project, NOT as an Eclipse whatever project)
This imported the thing into eclipse with all the necessary dependencies and without errors.