Translate

Показ дописів із міткою maven. Показати всі дописи
Показ дописів із міткою maven. Показати всі дописи

вівторок, 28 квітня 2015 р.

#ProjectFromScratch: Multi module project - Part1


I will try creating new project from scratch step-by-step and write down all steps
If you see better approach or just easier way - please leave comment and I will modify article. Also you can suggest technologies and configurations for that new project
It allows all of us  to gain interesting collective experince

So lets start

Step1: Creating multimodule project with maven
Maven is still most popular build system that's why maven, but if anybody provides code for gradle I will add it to post also
 
//create parent
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=RELEASE
go inside parent folder and create child modules
 
//first module
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE
//create one more module
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE


I created two modules core for common things and web




пʼятниця, 11 січня 2013 р.

Webinars. January



Webinars від Spring Source

17 Січня 17.00    SPRING FRAMEWORK 3.2 - THEMES AND TRENDS
Реєстрація тут

24 Січня 17.00    ARCHITECTURE OF A MODERN WEB APP
Реєстрація тут

31 Січня 17.00   IOC + JAVASCRIPT
Реєстрація тут

Webinars від компанії Exigen Services  (http://www.exigenservices.ru)

23 Січня 13.00 "Apache Maven 2" part 1
30 Січня 13.00 "Apache Maven 2" part 2

Посилання на реєстрацію і детальну інформацію тут



понеділок, 10 грудня 2012 р.

Використовуйте краще. IntelliJ IDEA


Навздогін до новини про вихід нової версії  IntelliJ IDEA (захотілось написати):
 
Історично склалось, що в Україні більшість Java девелоперів використовують Eclipse.

Причин цьому можна знайти безліч, але основними є:
- так історично (ця фраза означає - не знаю чому, але юзаю, бо боюсь спробувати, щось іньше);
- всі використовують (приблизно те саме, що і попереднья відповідь)
- все інше платне, або криве. (відмазка)
- вимоги замовника (справді вагомий аргумент)
 - пробував і мені більше подобається Eclipse, бо... (тут також все ок, людина спробувала і не захотіла по об'єктивні причини - буває)


Хочу навести декілька причин дял того, щоб подивитись навколо і спробувати використовувати не те, що "історично склалось", а те, що краще.

В цій статті хочу показати чому я в більшості проектів використовую IntelliJ IDEA 11.1.4(мігрую на 12 )

Отже.  IntelliJ IDEA - це платна IDE, яка мусить бути на голову кращою за безкоштовні. Ціна її складає $199. Я почав своє використання IntelliJ IDEA з Community Edition, яка є 100% безкоштовною і має 80-90% функціоналу платної версії.



неділя, 6 березня 2011 р.

How to create gwt maven project?


How to create gwt maven project? Easy! Just run

mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.1.0-1

This maven plugin generates project based on GWT version 2.1.0  If you prefer to use version 2.2.0, just replace version in pom.xml. Then the following compilation error will occur

java.lang.NoClassDefFoundError: com/google/gwt/core/ext/GeneratorExt
[INFO] at java.lang.ClassLoader.defineClass1(Native Method)
[INFO] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
[INFO] at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

You should add dependency on gwt-dev.jar

<dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>2.2.0</version>
        <type>jar</type>
        <scope>compile</scope>
</dependency>
By maven-googlewebtoolkit2-plugin

субота, 5 березня 2011 р.

Maven Multi-Module Quickstart



Recently I’ve had lots of questions about how to create multi-module projects, so when I discovered this technique, I thought I’d write this up. This technique exploits a little known feature of the archetype:create plugin, and the Maven site archetype to kickstart your project. Creating a multi-module project has many benefits, one of them being the ability to build every artifact in a project with one simple “mvn compile” command. Another benefit is that if you are using either the maven eclipse:eclipse plugin or the idea:idea plugin, you can enter this command at the root of the project and it will generate all of the project files for all of the contained modules.

First generate the top level project using the maven-archetype-site-simple archetype using the following command,
mvn archetype:create
 -DgroupId=[Java:the project's group id]
 -DartifactId=[Java:the project's artifact id]
 -DarchetypeArtifactId=maven-archetype-site-simple
this will generate a Maven project with the following directory structure.
Maven Site Simple Folder
The project that is generated is the minimum project setup to generate site documentation. The index.apt file is the main index page for the site, and is written in the Almost Plain Text format, which is a wiki like format. You can also generate a more complete site project using the maven-archetype-site archetype like this,
mvn archetype:create
 -DgroupId=[Java:the project's group id]
 -DartifactId=[Java:the project's artifact id]
 -DarchetypeArtifactId=maven-archetype-site
this will generate the following project structure.
Maven Site Folder Structure
After you have generated the site project, edit the pom.xml created from the site archetype plugin. Make sure the the packaging type is set to “pom” like the following.
1<project>
2    <modelversion>4.0.0modelversion>
3    <groupid>com.pillartechnologygroupid>
4    <artifactid>sampleProjectartifactid>
5    <version>1.0-SNAPSHOTversion>
6<packaging>pompackaging>
7...
8project>
By setting the packaging type to “pom”, any projects you generate from the root of the project directory will insert itself into the project by creating an entry into the modules section of the pom.xml for the site. In the root directory of your project that you created above, type in the following command,
mvn archetype:create
 -DgroupId=[Java:the module's group id]
 -DartifactId=[Java:the module's artifact id]
if you now edit the pom.xml for the main project, you should see an entry towards the bottom of the file like the following.
1...
2<modules>
3    <module>sampleModulemodule>
4modules>
5...
взято звідси

 можна також скористатись командою

1
mvn archetype:generate
тоді в інтерактивному діалозі потрібно вибрати потрібний айтем
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Choose archetype:
1: remote -> docbkx-quickstart-archetype (-)
2: remote -> gquery-archetype (-)
3: remote -> gquery-plugin-archetype (-)
...
205: remote -> pom-root (Root project archetype for
creating multi module projects)
...
306: remote -> trails-secure-archetype (-)
307: remote -> tynamo-archetype (-)
308: remote -> wicket-scala-archetype (Basic setup for a
project that combines Scala and Wicket,
        depending on the Wicket-Scala project. 
Includes an example Specs
        test.)
309: remote -> circumflex-archetype (-)
Choose a number: 82:

в даному випадку для батьківського багатомодульного проекту це 205 елемент ну і далі по аналогії створюємо дочірні модулі