Maven ist ein Build-System für komplexe Projekte.

Anweisungen#

Artifact manuell installieren:

mvn install:install-file -DgroupId=com.intersult -DartifactId=com.intersult.skin -Dversion=1.0-SNAPSHOT -DgeneratePom=true -Dfile=com.intersult.skin-1.0-SNAPSHOT.jar -Dpackaging=jar

Artifact deployen:

mvn deploy:deploy-file -DgroupId=com.intersult -DartifactId=com.intersult.skin -Dversion=1.0 -Dpackaging=jar -Dfile=target/com.intersult.skin-1.0-SNAPSHOT.jar -Durl=file://W:\deploy\repository.war -DrepositoryId=intersult-repository

Glassfish deployen:

mvn glassfish:deploy

Exec plugin:

		<pluginRepository>
			<id>codehaus snapshot repository</id>
			<url>http://snapshots.repository.codehaus.org/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
		</pluginRepository>
                ...
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<executable>${env.GLASSFISH_HOME}/bin/asadmin</executable>
					<arguments>
						<argument>deploy</argument>
						<argument>target/test.war</argument>
					</arguments>
				</configuration>
			</plugin>

mvn exec:exec

Manual ant task:

	<profiles>
		<profile>
			<id>echo</id>
			<activation>
				<property>
					<name>command</name>
					<value>deploy</value>
				</property>
			</activation>
			<build>
				<defaultGoal>antrun:run</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.3</version>
						<configuration>
							<tasks>
							    <echo>Hello World!</echo>
							</tasks>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

mvn -Dcommand=echo