svn:externals
, there were only tests that were freely executed via $ phpunit AllTests.php
, and the transfer of changes to the $ phpunit AllTests.php
server ( svn export
+ small self-written script). Even a fairly good article about using ant in eclipse did not make me use this tool, and I didn’t want to write any build files either ...mvn
vs ant
.validate
- validates project metadatacompile
- compiles sourcestest
- runs class tests from the previous steppackage
- packs compiled classes in a conveniently movable format (jar or war, for example)integration-test
- sends packed classes to the integration testing environment and runs testsverify
- verifies the package’s correctness and quality requirementsinstall
- pushes the package to the local repository, from where it (pec) will be available for use as a dependency in other projectsdeploy
- sends the package to a remote production server, from where other developers can get it and use it$ mvn package
, then the steps will actually be executed: validate, compile, test, and package. Thus, using maven is quite simple. You wrote the code, executed the mvn test and you can continue to work, making sure that the code does not contain syntax and logical errors.svn:external
, especially if the library takes up enough space, but it is enough to specify it in the dependency file and it will be taken from the local repository mavena. When specifying dependencies, you can specify not only the library name, but also its version - in this way there will be no problems with backward compatibility.tomcat-maven-plugin
. It is configured in pom.xml and has approximately the following form:[...] <plugins> <plugin> <groupid> org.codehaus.mojo </ groupid> <artifactid> tomcat-maven-plugin </ artifactid> <version> 1.0-beta-1 </ version> <configuration> <path> / </ path> <url> http: //site.local: 8080 / manager </ url> <server> site.local </ server> </ configuration> </ plugin> </ plugins> [...]
path
is responsible for the path to which the servlet will be deployed. Since we are deploying a fully-fledged, self-contained web application, we will deploy to /. Url
points to the path to the host manager, through which we will be deployed. A manager servlet is usually created during the creation of a new virtual host . Server
specifies the server id. Here you need to go deeper into the explanation ...~/.m2/settings.xml
file in the servers
section. So my section looks like this:[...] <servers> <server> <id> site.local </ id> <username> manager </ username> <password> manager </ password> </ server> </ servers> [...]
username
and password
must match the user with manager rights from the tomcat-users.xml
(see the previous article on servlets for more details).$ mvn tomcat:deploy
and maven take care of compiling, testing, packaging and deploying the project. It will only update the browser page to see the changes.$ mvn archetype: create \ -DarchetypeGroupId = org.apache.maven.archetypes \ -DgroupId = com.mycompany.app \ -DartifactId = my-app
Source: https://habr.com/ru/post/77333/
All Articles