In IntelliJ IDEA is there a way of creating a Spring Template Project as in Spring Source ToolSuite ? The intention over here is to get a POM file created automatically with the dependencies related to a Spring Project as in Spring Source ToolSuite. The existing way of IntelliJ IDEA is to create a Maven project and then to modify the POM file. Any information regarding this would be appreciated.
I don't know much about intelliJ, but all of the template projects are available on giyhub. There are URLs that aggregate the links to the template repositories. Take a look at these two files and the clone the project that you want to use as a template:
http://dist.springsource.com/release/STS/help/descriptors-3.0.xml
https://raw.github.com/SpringSource/spring-integration-templates/master/si-sts-templates/builds/descriptor.xml
Related
I would to like to add the dependent jars to the update site plugin project in Eclipse.
I followed
http://wiki.eclipse.org/FAQ_How_do_I_create_an_update_site_%28site.xml%29%3F
but, it does not address the above issue. How to deal with the dependent jars with deploying plugin? Anybody please help with ideas.
Thanks
I'm going to assume you are wanting to add additional Jar files to your plugin. You can do this by simply putting the Jar files into the top level directory of your plugin, and in the Classpath portion of the Runtime tab in the Plugin Manifest Editor you can specify the Jar file. This will automatically add it to the build path as well.
Some people prefer to make an extra plugin that contains nothing but external Jar files; you add the Jar files to this extra plugin the same way and then just use the Dependencies tab in the Plugin Manifest Editor to make your original plugin dependent on the Jar plugin.
I want to create a maven2 project from artifacts in maven2 repository (POM and sources). Of course,I can create the directory structure, copy POM file and extract the sources manually. But I wonder if I can automate this task with maven.
Maybe dependency:unpack-dependencies can help you? Note, there are parameters such as classifier, copyPom, outputDirectory, type, etc that can be used to configure the content of the output.
Perhaps Maven archetype plugin can serve your need? It allows you to create an archetype, which can then be used to create a project.
How to convert a Ant project to Maven project? A sample project that would link (a Wicket project)
Thanks
The nice part of using maven is that most standard stuff works automatically once you do things the maven way. For a simple webapp:
Create a pom with groupId, artifactId and version (packaging: war)
Add the required dependencies to the pom
move the
java sources to src/main/java,
resources to src/main/resources,
webapp content to src/main/webapp,
test content to src/test/java and src/test/resources
set the compiler compliance version using the maven compiler plugin
That should get you up 'n' running.
http://www.sonatype.com/people/2009/04/how-to-convert-from-ant-to-maven-in-5-minutes/
I don't know what your ant script looks like, but assuming its a basic script for building, you will need to create a pom.xml file for your project, add your dependencies, and then build it via maven.
For anyone who lands here in future, there is an easier way to find dependencies for maven using the file hashes. So, you won't have to guess artifact versions.
As per the below article, the idea is to generate a SHA1 checksum of the dependency that you want to find the information, then do a reverse search in Nexus repository manager using that hash. For the checksum generation, you can use Microsoft's FCIV (free) utility.
https://devreads.xyz/ant-to-maven-conversion-the-painless-method/
I have a project that uses the built-in IntelliJ build system. What's the quickest/best way to migrate the project to Maven?
What's the quickest/best way to migrate the project to Maven?
Manually. Here is what I would do (I would personally use the command line):
create a parallel (potentially multi-modules) project structure using archetype(s)
declare dependencies for the jars you're using (not all of them, you'll get some transitively)
move sources and resources to the new structure
test the build
import the project back into your IDE
IDEA understands Maven very well. Unfortunately it does not create Maven configuration for you.
You'll have to write pom.xml yourself. The complexity of this depend on the structure of you project and frameworks/libraries that you use.
For me the easiest way is to create a new project based on artifact and then copy existing source files into it. You can do this in IDEA:
File -> New project -> Create project from Scratch
Choose Maven module, Next
Check Create from Artifact: a list of available artifact will show. Choose one based on libraries/frameworks you use. You can also add one if it's not on the list (search the web).
When project setup is done, start copying sources.
In our project we are using jaxb2-maven-plugin to generate Java source code from XML Schema, which causes that our Maven module requires additional source code directory (in our case target/generated/main/java). Up to date I've been using Eclipse and maven-eclipse-plugin to import all the projects into Eclipse workspace. The plugin is (somehow) able to add the directory with generated source code automatically to Eclipse' .classpath file.
Recently I try to switch to (play with?) IntelliJ IDEA 9 (so I am a newbie in this environment) and I've noticed that additional source directory is not added during IDEA's importing process...
Is there any way I can configure IDEA/Maven to make importing directory with generated source code automatically?
The convention with Maven is to generate code in target/generated-sources/<tool>, for example target/generated-sources/jaxb2
Follow this convention and IDEA will add the folder as source folder (see IDEA-53198).
Generated code, using jaxb2-maven-plugin, was missing for me in Intellij 2017.1 whereas Eclipse Neon created it.
Fixed it from context menu of module by selecting 'Maven -> Generate Sources and Update Folders'.
Try with maven-jaxb2-plugin. If it does not work then it's IDEA problem.
In Maven you can add new source roots per configuration. Maven plugins can do this programmatically. This is for sure the case with maven-jaxb2-plugin. Then, if IDEA does not recognize it, then it's a problem on that side.
You can use the Maven Build Helper Plugin. It is located at http://www.mojohaus.org/build-helper-maven-plugin/
It allows to configure additional source roots. And the maven integration of IntelliJ will add the new source root. We are using this feature in quite a few builds and it works just fine. Tested with vers. 13 of IntelliJ IDEA.