Maven

Elegantní způsob ukládání verzi v Java archívech

Package pkg = someClass.getPackage(); String version = (pkg != null ? pkg.getImplementationVersion() : ""); Specification-Title: Forms module Specification-Version: 2.0-SNAPSHOT Specification-Vendor: FG Forrest, a.s. Implementation-Title: Forms module Implementation-Version: 2.0-SNAPSHOT Implementation-Vendor: FG Forrest, a.s. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> </manifest> </archive> </configuration> </plugin> <!–- ********************************************************************** * Increase build number ********************************************************************** --> <target name="usage"> <propertyfile file="${config.

Teamcity & CVS & Maven: release on server

<scm> <connection>scm:cvs:ext:anonymous@mycvsserver:/CVSRoot/groupFolder:projectX</connection> </scm> java.lang.IllegalArgumentException: Unrecognized CVS Root: :ssh:anonymous@mycvsserver:/CVSRoot/groupFolder at org.netbeans.lib.cvsclient.connection.ConnectionFactory.getConnection(ConnectionFactory.java:88) at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.connect(CvsConnection.java:158) at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.processCommand(CvsConnection.java:475) at org.apache.maven.scm.provider.cvslib.cvsjava.command.checkin.CvsJavaCheckInCommand.executeCvsCommand(CvsJavaCheckInCommand.java:55) at org.apache.maven.scm.provider.cvslib.command.checkin.AbstractCvsCheckInCommand.executeCheckInCommand(AbstractCvsCheckInCommand.java:89) at org.apache.maven.scm.command.checkin.AbstractCheckInCommand.executeCommand(AbstractCheckInCommand.java:53) at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:58) at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.executeCommand(AbstractCvsScmProvider.java:521) at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.checkin(AbstractCvsScmProvider.java:585) at org.apache.maven.scm.provider.AbstractScmProvider.checkIn(AbstractScmProvider.java:365) at org.apache.maven.shared.release.phase.ScmCommitPhase.checkin(ScmCommitPhase.java:124) at org.apache.maven.shared.release.phase.ScmCommitPhase.execute(ScmCommitPhase.java:109) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:194) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:131) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:94) at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:136) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:227) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)

Maven2, release plugin a přístup do CVS přes SSH s privátním klíčem

<scm> <connection>scm:cvs:${protocol}:${username}@${servername}:${CVSROOT}:${MODULE}</connection> <developerConnection>scm:cvs:${protocol}:${username}@${servername}:${CVSROOT}:${MODULE}</developerConnection> <url>http://${servername}</url> </scm> <systemProperties> <myproperty>myvalue</myproperty> </systemProperties> <distributionManagement> <site> <id>website</id> <url>scp://${servername}/${path}</url> </site> </distributionManagement> <servers> <server> <id>website</id> <username>${username}</username> <passphrase>${passphrase}</passphrase> </server> </servers> mvn release:prepare release:perform -Dmaven.test.skip=true <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <jvm>${JAVA_1_4_HOME}${JAVA_EXECUTABLE}</jvm> <skip>${SKIP_TESTS}</skip> <excludes> <exclude>**/Abstract*Test.java</exclude> <exclude>**/Abstract*TestCase.java</exclude> <exclude>**/Test*.java</exclude> </excludes> </configuration> </plugin>