I'm trying to import Mahout's maven resource to eclipse, but i meet these errors:
I have tried google but it doesn't help.
Eclipse : Helios Service Release 1
Maven : External Maven 3.
Edit: If I try to play with latest stable release ( Mahout 0.7 ) and not the latest snapshot that the official site recommends for downloading, I experience the same error.
Follow step-by-step this link: https://cwiki.apache.org/MAHOUT/buildingmahout.html
After doing this and re-importing mahout, these errors you noticed go away.
Notice: Before compiling the code in the right way (as stated at the link above), I have followed the instructions from here:
http://domengrabec.wordpress.com/2010/12/14/installing-maven-on-eclipse/
Q: If anyone could help me with this related issue:
Include classes of Mahout math libraries of both core & math folders - Eclipse - Hadoop , I would be grateful.
I think what you need is to build mahout in a different way,
first install m2e plugin for eclipse, then you can create maven project. You can make the run configuration (package) after that to make sure everything is fine.
The important part is that you have the pom.xml in the project so you have to add the dependencies of mahout that you want.
You can get the dependencies from searching on google " name of the dependency in mahout api".
i solved it by manually applying the patch in https://issues.apache.org/jira/browse/MAHOUT-1043 to 0.7 sources (changes pom.xml files and src/conf/driver.classes.conf )
just one note, do not remove the groupid in distribution/pom.xml
launch an external mvn eclipse:clean and update the projects. All errors are gone when workspace is rebuilt
Related
Update
The reason I couldn't update properly was I didn't have game's jar file properly installed. That was fixed by first running this on the command line:
mvn install:install-file -DgroupId=com.mygame -DartifactId=mygame-core -Dversion=0.9-beta -Dpackaging=jar -Dfile=/home/klenwell/projects/mygame/playn/mygame/java/target/mygame-java-0.9-beta.jar
Then, in Eclipse, I right-clicked java folder > Maven > Test. This updated all my dependencies including lwjgl.
Otherwise, see thomasbroad's answer.
Original Question
I've consulted the following authorities on this topic and applied their various recommendations:
http://lwjgl.org/installation.php
http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_Maven
http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_Eclipse
https://stackoverflow.com/a/11065814/1093087
https://groups.google.com/forum/?fromgroups#!topic/playn/E2t7gNh4ab0
https://groups.google.com/d/msg/playn/3D4JZ1Dbm-E/HmPHofS2fqgJ
Part of the problem is I'm not sure whether I should be following the Maven instructions or the Eclipse instructions. I've tried both and everything in between.
I'm working in Ubuntu 12.04 64-bit on Eclipse using Maven. Everything was working fine until I changed the PlayN version in my POM file from 1.2 to 1.3.1 and introduced the lwjgl dependency.
What I would have expected to have worked:
1) Download lwjgl (latest version 2.8.4) and test per lwjgl.org instructions (this was successful)
2) Update the appropriate POM files
2A) Add lwjgl.version as a property to mygame/pom.xml
<properties>
<playn.version>1.3.1</playn.version>
<lwjgl.version>2.8.4</lwjgl.version>
</properties>
2B) Add lwjgl as a dependency to mygame/mygame-java/pom.xml
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
</dependency>
3) Right-click mygame-java project in Eclipse > Run As > Run Configurations > Arguments and add either -Djava.library.path=target/natives or -Djava.library.path=/absolute/path/to/my/lwjgl/lib to VM arguments. (I've tried both variations.)
I can see the dependencies listed under my java project folder in Eclipse. And when I follow the lwjgl.org guide for Eclipse, I can see the jar listed under the java project folder. But I still get the error.
After two hours of hair-wrenching frustration, I hope somebody can either point out my fatal oversight or provide explicit instructions that will help me get back to work. Thanks.
I upgraded my project from 1.2 to 1.3 a while ago. I only updated my pom.xml files to refer to the new version of PlayN . I did not manually install lwjgl and neither did I add the lwjgl dependency as that one is implicitly pulled in by PlayN
Manually apply the diffs found here to your project, to your poms.
The key part being the piece in the java pom that tells Maven to unpack native dependencies. This part was actually added in the previous diff, so you may want to look there as well.
Now your IDE will most likely tell you that your project is not up-to-date with your poms, update your project, this should pull in the lwjgl dependency and set it up correctly.
I believe you should add the -Djava.library.path arguments to the VM Arguments, not to the Program Arguments in your runtime configuration.
The other -using maven- option is described on the Getting Started page, it worth noting, that the default embedded Maven is buggy for development, you should download and use at least Maven 3.0.3 as it is mentioned on the page (but I guess you already do this).
I just started a new project fresh with PlayN 1.4 and encountered this issue again in Eclipse. Resolved it as follows:
Right click mygame-java > Run As > Run Configurations...
Then added the following to VM Arguments under Arguments tab:
-Djava.library.path=target/natives
Then successfully ran as application.
At one point, I also ran the mvn install:install-file... command mentioned in question but I'm not sure whether that was necessary or not.
I've seen that there are quite a few questions regarding this problem, but unfortunately none have solved it for me. Here is a screencap of what's going on:
It is dependent on the android-support-v4 jar file which as you can see is added to my build path. It the exact jar file from the maven library directory's libs folder. I've tried the following:
Restarting Eclipse
Cleaning the project
Right-clicking the project and updating dependencies
Updating project configuration Disabling and re-enabling workspace resolution
Nothing has helped. Is there any other tricks to getting this resolved? All of the answer's I've seen suggest doing these things that I have already tried.
Thanks a lot!
Actual root cause:
The OP JMRboosties reports in this instance having to desactivate Proguard (the tool which shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names)
disabling proguard on the line where the error occurred (the <plugin> item) in pom.xml solved the problem
(See "How to use ProGuard with android-maven-plugin ").
Certain side-effects can result from using Proguard: For example, the Proguard page does mention:
The default proguard.cfg file tries to cover general cases, but you might encounter exceptions such as ClassNotFoundException, which happens when ProGuard strips away an entire class that your application calls.
Original answer:
As mentioned in this GitHub post:
you need to use maven Android SDK Deployer to install it:
I'm going to deploy my own android artifacts to my personal repository to avoid having this problem again.
If you're not explicitly using Maven you can just import it as a regular Android project into eclipse and it'll pick up the .jar from the libs/ directory.
(Note your android-support-v4.jar isn't in libs in your project)
declare it in your pom.xml.
You have to install both Android 1.6 and the compat lib using the maven SDK deployer for now.
cd to platforms/platform-4/ and extras/compatibility-v4/ in the deployer and run mvn install in each.
Hopefully the compat lib makes it into maven central soon so I can avoid this step.
Again, the project is set up to be used as a normal Android project in eclipse too completely separate from maven.
File, New, Project, Android, use existing sources, select library/ folder.
Assuming you're using m2e-android behind the scenes, the reason you're getting compile problems is that the m2e-android plug-in strips out all provided scope dependencies from the Eclipse project classpath.
We do this because, due to changes in ADT 16.0.0, any JAR file in the Eclipse classpath will be packaged into distributable APK file.
I would just like to setup a new GWT project in Eclipse and use Maven for dealing with all the jar jungle. I used gwt-maven-plugin with this instructions, but I can't get the project to work in Eclipse.
What I've actually done:
Created a maven project using the archetype gwt in command line.
Imported the projet in eclipse using import > existing maven project
While doing that I had errors saying:
gwt-maven-plugin:2.3.0-1:generateAsync - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:i18n - "No marketplace entries found to handle"
gwt-maven-plugin:2.3.0-1:exploded - "No marketplace entries found to handle"
These errors don't go away even if I ignore them on the import.
How can I make these projects working? Is the problem that I skipped the "process-resources" setting? (There is no such setting in the latest version of m2e.)
Should I even use gwt-maven-plugin? Is there any other way of making a GWT project to use Maven? Or – is there any other way to fight with the jar jungle? What does GWT guys use?
I use Eclipse Indigo with m2e plugin 1.0.0 and Google suite plugin version 2.3.3.
Eventually I gave up Maven. As one other developer said "good ideas and bad code build communities faster" , I also remember my experience with Maven on all the projects: very promising on the beginning, but eventually you get to some problems and end up working more with configuring Maven than actually dealing with your own code.
I decided to manually copy needed .jar-s into /lib folder. I spent some time due to transitive dependencies, but LESS than dealing with Maven and now I have things under control. If sometime in the future working with libraries will become an overhead, I will consider using Ivy.
If someone wishes to stick with Maven, I lately found a very useful link by Google team:
http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
They recommend using their sample projects and not gwt-maven-plugin archetypes (due to issues). I agree. They also provide needed pom lifecycle changes for Eclipse Indigo.
According to a recent post on the gwt-maven-plugin mailing list the Maven integration is not complete for Eclipse Indigo, since the M2Eclipse 1.0 release has brought about a large number of changes. The suggested workarounds from David Chandler, Google engineer, are:
You can run "mvn package" on the command line or right-click on the project > Maven > Run as > Maven build.
The plugin execution failures you're seeing can be resolved by adding lifecycle mapping metadata as in the sample POMs. They are only needed for Indigo. You should not get these errors in Helios or when running mvn package from the command line.
Disclaimer: The following guidelines are for Windows users. These steps are on the basis that, they have worked when tried by the replier and doesn't guarantee fulfledge working unless experimented by self and tried with proper prerequisites.
::Creating a simple gwt project using archetype::
Following are few commands that can be used to create a simple gwt project "Web Starter Application":
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0
mvn -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 org.apache.maven.plugins:maven-archetype-plugin:generate
mvn -DarchetypeGroupId=org.codehaus.mojo
-DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0 -DgroupId={project packaging} -DartifactId={application name} -Dversion=1.0 -Dmodule={module name} org.apache.maven.plugins:maven-archetype-plugin:generate
(The value of archetypeVersion can be 2.3.0 or any higher stable version.)
Few coordinates are required by maven to create the gwt project. They are as follows:
groupId
artifactId
version
module
The first command doesn't take any of the above coordinates hence, we need to supply them at the time it executes. Notice that the archetype goal is mentioned right at the beginning of the command. It is mandatory to give the archetype goal.
The meanings of these coordinates can be found here.
One of the best ways to start with understanding maven is this.
The second command doesn't consider the module name hence, you will be prompted to give it at the time the command executes.
The third command is equivalent to running it in batch mode where you just have to confirm the inputs for groupId, artifactId, version, module as mentioned in command itself.
Once any of these commands gives a BUILD SUCCESS result, then navigate to the just-now-created project folder from command line and execute the following command:
mvn gwt:run
It should start the project in Development Mode so that you can Launch the Default Browser to run the project or Copy the URL to clipboard and navigate to it through any browser.
Good luck with the execution.
I checked out an open-source project from SourceForge's SVN source control using the Eclipse Maven plugin. After it checks out, I get this error in the pom.xml file:
Error resolving version for plugin
'org.apache.maven.plugins:maven-source-plugin' from the repositories
[local (C:\Documents and Settings\thomas.owens\.m2\repository),
central (http://repo1.maven.org/maven2)]: Plugin not found in any
plugin repository
I'm fairly new to Maven, but I followed the installation instructions for Apache Maven and the Eclipse plugin. It seems weird that this plugin would not be found in the central plugin repository for Maven or my local repository, when I can clearly see a directory located at C:\Documents and Settings\thomas.owens\.m2\repository\org\apache\maven\plugins\maven-source-plugin that contains a single resolver-status.properties file.
Any thoughts as to why this plugin might not be found and where I can find it?
The problem that I was encountering was not an issue with the maven-source-plugin, but incorrect proxy settings that was preventing the connection to the repositories. The answers to this question on the use of Maven with a proxy helped me to find the mistake and correct it.
That plugin is in the central repository.
Perhaps you just need to run with -U to update:
mvn -U clean install
Or in Eclipse: right-click on the project, select Maven-> Update Dependencies, (perhaps) Maven-> Update Project Configuration
Check if you are able to see Maven in Eclipse, Window > Preferences.
If so, select Maven and go to installations and check if the folder, in where maven was installed, is properly set. Then, set your setting.xml file, it should be in /(maven installation folder)/conf/
Then, right click in your project go to Maven > Update Maven Dependencies.
Did it help?
Which project?
Perhaps there is a bug in their pom.
Or perhaps they require a 'standardized' develop environment with specific environment variables set, or a specific setting in user.home/.m2/settings.xml
I want to create a web app that will use wicket, hibernate and spring frameworks. My IDE of choice is Eclipse, I am using maven for the .war generation and I am running Mac OS. What steps should I follow to correctly install and configure all the tools so as to have a project running that relies on these 3 frameworks. I was able to successfully set up wicket but I am having trouble for setting up hibernate and spring. I went through multiple tutorials but I still couldn't find the solution.
Thanks!
I will now try to explain a bit what is the problem I can't solve. I first began with a clean project:
mvn archetype:create -DgroupId=test.framework -DartifactId=microForum
Moved on to the project folder and mvn eclipse:eclipse
Imported the project from eclipse
Looked into the apache wicket homepage where there are multiple examples, so I read through the page and that was enough to learn what to add to the pom and had wicket and everything up and running nicely
My next step was trying to use hibernate and/or spring. I thought that "adding" hibernate and spring in the same way I added the wicket necessary configurations and dependencies to the pom (by hand) might not be that easy. So I tried using the maven archetype: appfuse-basic-spring. So:
mvn archetype:generate -> launchs the wizard that lets you choose among different archetypes
After choosing the archetype number 2 ( Hibernate + Spring + Spring MVC) it fails
After googling a bit I found out why it fails (something like I should add a -archetype after appfuse-basic-spring. So, instead of using the wizard, I put:
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring*-archetype* -DarchetypeVersion=2.1.0-M1 -DgroupId=test.framework -DartifactId=microForum2
This created my project (after multiple warnings). I paste a screenshot (Image 1) because some of the information might have some important meaning :
http://img97.imageshack.us/img97/6687/screenshot20100323at112.png
- Image 1
I then did mvn eclipse:eclipse and it started downloading millions of things, which seemed very odd so I Control+C it.
Following schmimd04 answer I tried to use the eclipse maven plugin but I couldn't create a maven project:
Unable to create project from archetype [org.appfuse.archetypes:appfuse-basic-spring:RELEASE]
The defined artifact is not an archetype
Thanks!
p.d: My Mac OS already had maven installed (version 2.2.0), I tried downloading the last one and repeating the same steps but I still had the same trouble.
Bert's recommendation LegUp, jweekend.com/dev/LegUp, have worked just fine for me. I used the wicket + Spring + JPA archetype. I will still look for the reason why maven's Hibernate+Spring+Spring MVC archetype didn't work for me. I'll edit this once I have the answer. For the time being, legup did the job!
Thanks
Install the Maven plugin for Eclipse from the update site: http://m2eclipse.sonatype.org/update.
This will allow you to create Maven projects (I would start with the quickstart archetype) and easily add dependencies, such as Hibernate, Spring, and Wicket.
As Pascal is saying, your question is to broad to answer. A few pointers that might help you:
use 'mvn eclipse:eclipse' to generate an Eclipse project out of your pom.xml. There might even be a working eclipse project that allows to open a pom.xml as eclipse project. I can't say, i left eclipse behind for good.
spring is 'just' a library that need to be in your classpath. the above command will ensure it is there (if it is defind as dependency in the pom.xml) You need to define a applicationContext.xml for Spring that resides in your classpath. See the Spring documentation for that.
hiberate is similar, it is just a library that needs to be in the classpath and that needs to find a config file. in there, the connection to the database is described. See the hibarnate docu (or one of the many blogs out there) for more info.
If you are stuck with a particular problem, please describe it so people can help here.
Bert
I don't know if it sounds odd. But it is because you have archtype data in your .metadata for respective workspace. If you delete the workspace. You can create new archtype. I know deleting worksapce is not a good idea. But still it works.