Maven most useful commands
Hot to configure eclipse project
mvn eclipse:eclipse -DdownloadSources
How to run arbitrary class
mvn exec:java -Dexec.mainClass="com.example.MyClass" -Dexec.args="arg0 arg1"
How to download all the dependencies into chosen folder
mvn dependency:copy-dependencies -DoutputDirectory=dependencies
How to download all dependencies without its dependencies
mvn dependency:copy-dependencies -DexcludeTransitive=true
How to download arbitrary jar from maven repository
mvn dependency:copy -Dartifact="mysql:mysql-connector-java:5.1.32" -DoutputDirectory=.
mvn dependency:copy -Dartifact="mysql:mysql-connector-java:5.1.32" \
-DremoteRepositories=http://repo1.maven.apache.org/maven2 -DoutputDirectory=.
mvn dependency:copy-dependencies -Dartifact="org.codehaus.groovy:groovy-all:2.1.6" -DoutputDirectory=.
How to install POM file in local repository
mvn install:install -Dpackaging=pom -DfilePom=pom.xml -Dmaven.repo.local=/var/www/archiva/mvnrepo
How to install artifact into local repository with sources
mvn source:jar install
Extras
How to mirror juno metadata p2 repository
eclipse -nosplash -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source http://download.eclipse.org/releases/juno -destination file:/tmp/p2/metadata/juno
What is MavenSession object
Is used as a shared container contains:
- container of PlexusContainer type
- request of MavenExecutionRequest type
- request of MavenExecutionResult type
- repositorySession of RepositorySystemSession type
- settings of Settings type
- executionProperties of Properties type
- currentProject of MavenProject type
- projects of List<MavenProject> type
- allProjects of List<MavenProject> type
- topLevelProject of MavenProject type
- projectDependencyGraph of ProjectDependencyGraph type
- parallel of boolean type
- pluginContextsByProjectAndPluginKey of Map<String, Map<String, Map<String, Object>>> type
Tycho
Debugging tycho
Additional debug logs: -Dtycho.debug.resolver=true
Disable lifecycle participation: -Dtycho.mode=maven or -Dm2e.version
Where target plaftorm is computed:
tycho-core:org.eclipse.tycho.core.resolver.DefaultTychoResolver
Brak komentarzy:
Prześlij komentarz