Eclipse (STS) trying to create appfuse-basic-jsf:RELEASE fails - java

I am getting really frustrated with this, I have installed the latest STS release from Spring and I am now trying to setup a simple archtype Project based on appfuse-basic-jsf.
By selecting New -> Maven Project -> Select appfuse-basic-jsf out of list
It always fails with the following error message:
Unable to create project from archetype [org.appfuse.archetype:appfuse-basic-jsf:RELEASE]
Under details it states:
The defined artifact is not an archetype
Any help would be greatly appreciated.

A better solution to this issue is to get the updated AppFuse archetypes (i.e. ones with the new archetype names, artifactIds etc) directly from a remote catalogue. To do this:
In your STS or Eclipse IDE, select the "Window" -> "Preferences" menu item.
On the Preferences screen, expand the Maven node in the leftPane's treeview.
Under the Maven node, select "Archetypes".
Click "Add Remote Catalog..." button, on the rightPane.
In the "Remote Archetype Catalog" dialogBox, specify the catalog url and description, by entering "https://oss.sonatype.org/content/repositories/appfuse/archetype-catalog.xml" for Catalog File, and an appropriate description (e.g AppFuse archetypes from remote catalog).
Click "Verify..." (this probably contacts the remote url and downloads+enumerates through the list of archetypes found) and then click OK.
Finally, click "Apply" and "OK".
After doing the above steps, when you create a new Maven Project, on the "Select an archetype" screen of the wizard, you can then select your newly added catalog on the catalogs dropdown list, and see all the available archetypes downloaded from the remote url. Pick your required archetype and it will successfully create the project, without the above issue.
NOTE: I am using Eclipse 4.3 (Kepler) for JavaEE, with m2e plugin installed.
For a detailed analysis of the issue, and steps to fix it including screenshots, see my blogpost at http://www.obinnakalu.blogspot.com/2013/09/a-solution-for-fixing-broken-maven.html

Right the problem occurs since the internal STS archetype catalog still references the old archetype names. They have now all got an extension "-archetype"
The solution I found was to run the script from command line - you can generate it on the following page:
static.appfuse.org/archetypes.html
I have also logged the issue in STSes JIRA - hope it will get addressed soon.

Related

Codename one/netbeans downloading demos does not work

I have downloaded all the demos of codename one, netbeans. I import the projects. No demo works for me. It shows errors missing jar files, and no main classes. How do i fix this?
See in picture.
showing all errors in downloaded projects
showing specific errors after pressing resolve, .jar missing
Update:
Codename one settings does not work.
I also struggled to get the demos working from the GitHub download, but that is the wrong approach. Shai's answer has already provided the solution, and this post is just expanding on that to clarify the exact steps required in NetBeans.
Step 1 of 3: Install the CodenameOnePlugin plugin:
Tools > Plugins > select the Available Plugins tab.
Select and check CodenameOnePlugin, then click Install.
The plugin will be installed and you will be invited to restart NetBeans, so do that.
Step 2 of 3: Create one of the Demos projects:
Select File > New Project.
After installing the plugin and restarting NetBeans, in the New Project dialog there is a new category named Codename One with a sub-category named Demos.
Select Demos and then select one of the projects from the Projects list such as CameraDemo and complete the New Project wizard:
Open one of the Java source files. You will see that there are no errors for unresolved imports.
Step 3 of 3: Run the demo project you just created.
Select the demo project you chose to create in the Projects tab, then press F6 to run it.
That's all there is to it! No downloading is needed, apart from installing the plugin. However, I did hit a couple of very minor issues:
During project creation some of the projects have the same default name of Demo. Just pick another name.
There is a build problem with certain projects such as Charts:
Unsupported source/binary format (in Charts)
The project source/binary format is older than minimal supported one
(1.6).
The solution is simple:
Select the project in the Projects tab.
Right-click and select Properties.
Select Sources and then update the value of Source/Binary format to 1.8.
I suggest using File -> New -> Codename One -> Demos instead.
Otherwise you need to place the right jars into the projects as they aren't included in git: https://www.codenameone.com/blog/tip-setup-codename-one-demo-from-git.html

what is the difference between refresh and update project in eclipse

I use eclipse with maven integration for my java web application project. When you right click the project you can "refresh" the project. You can also use "maven -> update project". What is the difference between refresh and update?
Sometimes I got a red-x sign in my pom file (I don't think there is any error). When I use the "refresh", the red-x sign disappears. Any idea?
Another question is that when I update the project, in the property -> deployment assembly, the maven dependencies was removed (I manually added them when I created the project). How can I fix this?
Thanks
A quick google search yielded this result: What does Maven Update Project do in Eclipse?
The correct answer states:
It syncs the Eclipse project settings with that of the pom. If you for example change important plugin settings, such as the output java version, you will find that Eclipse will ask you to update the project and afterwards the configured Java runtime in the project will have changed to reflect what your Maven pom indicates. That is an important thing to keep in mind: the Maven pom is the lead in this kind of project setup. If you want settings to change, try to do that through the pom and not through Eclipse project settings directly or doing a project update might revert what you have changed. There are usually some things I have to correct myself anyway though, such as build path exclusions that m2eclipse likes to put in and strange deployment assembly configurations.
So in short,
Updating your project through maven synchronizes the settings with that of pom and keeps all the settings synchronized between the pom and the project.
Refreshing your project through eclipse will reload the project - that is reload all the files and apply any external changes from the files to the project.
Note that a maven update will cause a refresh of the project in eclipse.
FYI, here's what the official documentation states:
Refresh command
The official Eclipse Oxygen documentation has two distinct (yet similar) definitions:
In Workbench User Guide > Reference > User interface information > Workbench menus > File menu it reads
Refresh (F5)
Refreshes the resource with the contents in the file system.
In Java development user guide > Reference > Menus and Actions > File actions it reads
Refresh
Refreshes the content of the selected element with the local file system. When launched from no specific selection, this command refreshes all projects.
F5
Update Project command
Unfortunately, the only documented occurrence I have found in m2e documentation (see m2e 1.5 release notes) is utterly insufficient and barely related:
The Update Maven Project dialog (launched via Right-click project menu:Maven[Update Project…] or via kbd:[Alt-F5]), now shows a dirty overlay on projects which need updating.
Additionally, an “Add out-of-date” button adds all out-of-date (OOD) projects to the current selection. If an OOD project has not been selected, a warning is shown underneath the selection table with a link equivalent to “Add out-of-date”. Warning text and “Add out-of-date” button tooltip show a count of unselected OOD projects.
Related questions on the 'Update Project' command (or the 'Update Maven Project' dialog):
(Which, alas, however insightful the best answers are, still provide no official statement from m2e developers.)
https://stackoverflow.com/a/20547404/4883320
https://stackoverflow.com/a/42562054/4883320

Spring Tool Suite (Eclipse) project run problems

So some quick background information to describe my problem. I have a project named Pear that contains a basic Spring project, using Maven. I put this exact project into a SVN repository, and then imported it into this same Eclipse/STS instance under the name of SpringTestRepo.
The problem is, this imported repository contains no Run options that the one I created in Eclipse originally has. For example, in the Pear project, Run -> Run As gives the option to run on an embedded Tomcat server. In the SpringTestRepo project, I have no options - anything past Run As is greyed out.
Another thing that I'm having a problem with in the difference between the two projects is that the one I imported via SVN (SpringTestRepo) has no little 'S' or 'M' by the name of the project. It's also missing several handy annotations, such as a list of methods underneath my HomeController.java class.
Here is a picture to help illustrate my problem.
Any ideas as to how to resolve this issue?
Edit: Just to be clear, it's a little hard to see but just above the Pear project there is a little Maven 'M' and a little Spring 'S' symbol.
I believe I solved the problem! To anyone else importing an SVN project into their STS and having trouble getting it recognized as a Maven/Spring project (the little 'M' and 'S' next to the project name), follow these instructions.
First, to import from your SVN repo after the Subversive Eclipse plugin, click File -> Import -> SVN -> Project from SVN and then press next. Enter in your repository location - in my case, it was svn+ssh://user#domainIp.goes.here/home/user/SvnRepositories/SpringTestRepo. This location will be wherever you are serving your SVN repo from - the beginning of the URL could be svn+ssh, http, https, or several other options depending on how your SVN is set up. Click next, and then click Finish when it asks you which Revision you want to import (I'm importing HEAD, which is selected by default).
A new dialog will pop up, giving you four different choices in the form of radio buttons as to how you want to import your project.
Logically, I tried 'Check out as a project with the name specified'. This is what yielded the picture in my question - a project not associated with Maven. What you need to choose is 'Check out as a folder into existing project'. Exit these dialogs, and create a new Spring MVC Project that you will import that SVN project into. That is File -> New Spring Project -> Spring MVC Project. Once you have created this project, go back through the steps and import your SVN repo project into the project you just created.
This resolved the issue for me. Feel free to edit if I missed anything. Thanks
You need to create a new run configuration. Eclipse doesn't know how to run your web app for you hence why its greyed out.
Check out this for starters:
http://wiki.openkm.com/index.php/Configure_Tomcat_server_in_Eclipse
http://www.codejava.net/frameworks/spring/spring-mvc-beginner-tutorial-with-spring-tool-suite-ide
Once you configure a server you can then select project to deploy to server and run.
Here is another good link to help you out run:
http://www.deepakgaikwad.net/index.php/2009/02/08/spring-mvc-tutorial-with-eclipse-and-tomcat.html

Maven 2 project error icon in Eclipse

I have create multi-module maven project in Eclipse IDE (already installed M2Eclipse plugin). There I can build my project successfully. But after build also it shows errors icon in my every module project. What kind of issue it can be?
Thank You.
Without knowing what errors you are seeing I am going to assume that your issue is with eclipse project properties (build path, src directory specification, output classes directory, etc).
You tagged m2eclipse plugin, so you should be able to right click on your project in eclipse select maven->update project configuration. If you do not see that option under maven then you should first see an option called maven->enable dependency management. Click that first and then you should be able to see update project configuration option.
If this does not fix it, then open your project directory containing the pom.xml file in command prompt and run mvn eclipse:eclipse.
One of the above should resolve those pesky error messages provided that your maven build itself is successful.
In eclipse open the Markers Tab (You can open it from Window -> Show View -> searching Markers)
It will show all the related errors with your project. You can identify your problems related to your problem, and solve accordingly. Sometimes it shows Quick Fix option, which is helpful.
For me, the above solution listed out by #CoolBeans was not working out, so i searched further and found out the following:
Go to Problems windows(present besides of Console window). If it is not there then click on Window-> Show View -> Problems
Inside Problems you will be able to see the Errors Description related to your project. In my case it was "java compiler level does not match the version of the installed java project facet". If that is the case for you as well, just follow below steps:
Right Click Project -> Properties
Click Project Facets(present in the left hand side list)
Choose the correct java version in Java Project Facet
Click Apply
That's it!

how install maven on eclipse

i want to install maven plug in on eclipse. but when add the maven site in install software section, and beginning to download and install it, an error occurred about dependency. how can fix it?
i want a complete installation guide...
Do these steps:
In Eclipse, go to "Help->Install New Software".
Press "Add" in the upper right button in the opened window.
Set the name textbox to be "Maven2Eclipse".
Set the value textbox to be http://download.eclipse.org/technology/m2e/releases
In case the link is not valid, get one from http://www.eclipse.org/m2e/download/
Press Ok, select the Maven project, and install it.
first which dependencies are missing?
A good maven plugin for eclipse is the eclipse maven sonatype, m2eclipse.
Install Maven Plugin for Eclipse
Installing a Maven Plugin for Eclipse can be a bit tricky if you want to get the whole spectrum of features. By default you would go to “Eclipse -> Help -> Software Updates -> Find and Install”, then “Search for new features to install”, then click on “New Remote Site”, and enter the Maven Projects name (e.g. Maven2Plugin) and its home URL there “http://m2eclipse.codehaus.org/“.
Once you install it at first everything would seem quite right. However, if you try “Import” a Maven Project, you will not see such an option in under the “General” menu, since it would be missing.
The reason for that is that “http://m2eclipse.codehaus.org/” brings in an old version of the plugin. (At the moment of writing) It brings in “Maven 2 Plugin 0.0.9″, whereas what you need is 0.0.12.
Hence you read the “Maven Integration for Eclipse” installation guide and point your “New Remote Site” to “http://m2eclipse.codehaus.org/update/” instead of “http://m2eclipse.codehaus.org/“. The one thing to be cautious about is an “update” link will try to also bring “subclipse” and “mylin” projects, hence you will need to “uncheck” them if you do not want to bring them:
⸺ from https://blog.dotkam.com/2008/02/24/install-maven-plugin-for-eclipse/
Steps to install maven plugin into eclipse:
In eclipse :
go to Help->install new software.
Copy this link http://download.eclipse.org/technology/m2e/releases on "Work With" edit box.
Select enter and maven link will appear on Name section.
Select that link and follow the steps to instal it on eclipse.
You can find more information regarding different maven builds for eclipse here:
http://eclipse.org/m2e/download/
STEPS TO INSTALL MAVEN (in Eclipse):
Maven Eclipse plugin installation step by step:
1. Open Eclipse IDE
Click Help -> Install New Software...
Click Add button at top right corner
At pop up: fill up Name as "M2Eclipse" and Location as "http://download.eclipse.org/technology/m2e/releases"
Now click OK After that installation would be started.
Another way to install Maven plug-in for Eclipse:
1. Open Eclipse
2. Go to Help -> Eclipse Marketplace
3. Search by Maven
4. Click "Install" button at "Maven Integration for Eclipse" section
5. Follow the instruction step by step
After successful installation do the followings in Eclipse:
1. Go to Window --> Preferences
2. Observe, Maven is enlisted at left panel

Categories