Category Archives: Maven

Maven project from archetype – Interactive mode

mvn archetype:generate -Dfilter=org.apache.maven.archetypes: Good ones for starting: maven-archetype-quickstart, maven-archetype-webapp mvn archetype:generate -DarchetypeCatalog=http://repo.maven.apache.org/maven2/archetype-catalog.xml -Dfilter=org.codehaus.mojo.archetypes: Good ones for starting: ejb-javaee6, ejb-javaee7

Also posted in Java | Leave a comment

jetty-maven-plugin 8.1.15.v20140411

Below a sample config for new version of jetty plugin for maven. <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.15.v20140411</version> <configuration> <webApp> <contextPath>/myapp</contextPath> </webApp> <reload>automatic</reload> <scanIntervalSeconds>1</scanIntervalSeconds> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8081</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> </plugin>

Also posted in Java | Leave a comment

Install JAR in local repo

Example of installing JACOB library in local repository repo: mvn install:install-file -Dfile=jacob.jar \ -DgroupId=com.jacob \ -DartifactId=jacob \ -Dversion=1.7 \ -Dpackaging=jar \ -DlocalRepositoryPath=repo \ -DcreateChecksum=true one line version: mvn install:install-file -Dfile=jacob.jar -DgroupId=com.jacob -DartifactId=jacob -Dversion=1.7 -Dpackaging=jar -DlocalRepositoryPath=repo -DcreateChecksum=true

Also posted in Java | Leave a comment

m2e + indigo

I’ve been suprised that in Eclipse Marketplace is no m2e plugin that works with Indigo right now. I saw… only juno or newer plugins. I found that this plugin version works good for me: http://download.eclipse.org/technology/m2e/releases/1.1/1.1.0.20120530-0009 (update site)

Also posted in Eclipse | Leave a comment

maven shade plugin: Executable jar with dependencies and excludes

<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.7.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <artifactSet> <excludes> <exclude>junit:junit</exclude> </excludes> </artifactSet> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.test.MainClass</mainClass> </transformer> </transformers> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>com/idontwant/that/class**</exclude> </excludes> </filter> </filters> </configuration> </execution> </executions> </plugin> </plugins> </build>

Posted in Maven | Tagged | Leave a comment

Tworzenie artefaktu z projektu Maven’owego

cd [katalog projektu / tam gdzie jest pom.xml] mvn archetype:create-from-project cd target\generated-sources\archetype mvn install Żeby użyć nowo powstałego artefaktu wystarczy uruchomić: mvn archetype:generate i wybrać nasz artefakt (najprawdopodobniej będzie na końcu listy)

Also posted in Java | Leave a comment