maven-install-plugin-2.4/0000775000175000017500000000000012236252402014755 5ustar ebourgebourgmaven-install-plugin-2.4/src/0000775000175000017500000000000012236252402015544 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/0000775000175000017500000000000012236252402016160 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/snapshot-pom/0000775000175000017500000000000012236252402020610 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/snapshot-pom/verify.bsh0000664000175000017500000000107711124702652022621 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/sp/test/maven-metadata-local.xml", "org/apache/maven/its/install/sp/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/sp/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/snapshot-pom/pom.xml0000664000175000017500000000436011124702652022132 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.sp test 1.0-SNAPSHOT pom Tests the installation of a simple snapshot POM. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 org.apache.maven.plugins maven-site-plugin 2.0-beta-5 maven-install-plugin-2.4/src/it/snapshot-pom/setup.bsh0000664000175000017500000000036611124702652022455 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/sp" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/release-pom/0000775000175000017500000000000012236252402020371 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/release-pom/verify.bsh0000664000175000017500000000073311124702652022400 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/rp/test/maven-metadata-local.xml", "org/apache/maven/its/install/rp/test/1.0/test-1.0.pom", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/release-pom/pom.xml0000664000175000017500000000451511124702652021715 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.rp test 1.0 pom Tests the installation of a simple release POM. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 org.apache.maven.plugins maven-site-plugin 2.0-beta-5 maven-install-plugin-2.4/src/it/release-pom/setup.bsh0000664000175000017500000000036611124702652022236 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/rp" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/snapshot-jar/0000775000175000017500000000000012236252402020571 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/snapshot-jar/verify.bsh0000664000175000017500000000121611124702652022575 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/sj/test/maven-metadata-local.xml", "org/apache/maven/its/install/sj/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/sj/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/sj/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/snapshot-jar/pom.xml0000664000175000017500000000435011124702652022112 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.sj test 1.0-SNAPSHOT jar Tests the installation of a simple snapshot JAR. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-jar-plugin 2.1 org.apache.maven.plugins maven-install-plugin @project.version@ org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/snapshot-jar/setup.bsh0000664000175000017500000000036611124702652022436 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/sj" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/minstall-55/0000775000175000017500000000000012236252402020232 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/minstall-55/test-0.1.jar0000664000175000017500000000053111126764144022212 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/minstall-55/invoker.properties0000664000175000017500000000013611161005513024020 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file maven-install-plugin-2.4/src/it/minstall-55/test.properties0000664000175000017500000000005311126764144023335 0ustar ebourgebourgfile = test-0.1.jar pomFile = test-0.1.pom maven-install-plugin-2.4/src/it/minstall-55/verify.bsh0000664000175000017500000000103011144255270022231 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/55/test/maven-metadata-local.xml", "org/apache/maven/its/install/55/test/1.0/test-1.0.pom", "org/apache/maven/its/install/55/test/1.0/test-1.0.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/minstall-55/pom.xml0000664000175000017500000000310211126764144021553 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.55 test 1.0 jar Tests the manual installation of a simple release JAR with a corresponding POM whose coordinates are inherited from the parent. org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/minstall-55/test-0.1.pom0000664000175000017500000000245011126764144022233 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.55 parent 1.0 test maven-install-plugin-2.4/src/it/minstall-55/setup.bsh0000664000175000017500000000036611126764144022105 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/55" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/MINSTALL-87/0000775000175000017500000000000012236252402017637 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/MINSTALL-87/invoker.properties0000664000175000017500000000036412005571022023431 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file -DgroupId=foo -DartifactId=foo -Dversion=1 -Dfile=/tmp/doesnotexit-foo-bar-wine-beer -Dpackaging=jar -DgeneratePom=true invoker.buildResult = failure maven-install-plugin-2.4/src/it/gav-validation/0000775000175000017500000000000012236252402021065 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/gav-validation/test.jar0000664000175000017500000000053111160530205022534 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/gav-validation/invoker.properties0000664000175000017500000000017411161005513024655 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file invoker.buildResult = failure maven-install-plugin-2.4/src/it/gav-validation/test.properties0000664000175000017500000000024411160543653024170 0ustar ebourgebourgfile = test.jar packaging = jar # using invalid coordinates should have install-file bail out groupId = invalid~group artifactId = invalid/artifactId version = 1+ maven-install-plugin-2.4/src/it/gav-validation/verify.bsh0000664000175000017500000000057611160530205023072 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/gv", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for absence of " + file ); if ( file.exists() ) { throw new FileNotFoundException( "Existing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/gav-validation/pom.xml0000664000175000017500000000307511160530205022402 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.gv test 1.0 jar Tests the manual installation validates the coordinates of the artifact just like the model validator would (MINSTALL-59). org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/gav-validation/setup.bsh0000664000175000017500000000036611160530205022723 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/gv" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/generate-pom-auto-1/0000775000175000017500000000000012236252402021647 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/generate-pom-auto-1/test.jar0000664000175000017500000000053111130472135023322 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/generate-pom-auto-1/invoker.properties0000664000175000017500000000013611161005513025435 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file maven-install-plugin-2.4/src/it/generate-pom-auto-1/test.properties0000664000175000017500000000020211130472135024735 0ustar ebourgebourgfile = test.jar groupId = org.apache.maven.its.install.gpa1 artifactId = test version = 0.1 packaging = jar createChecksum = true maven-install-plugin-2.4/src/it/generate-pom-auto-1/verify.bsh0000664000175000017500000000224611130472135023654 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.apache.maven.plugin.install.*; String[] paths = { "org/apache/maven/its/install/gpa1/test/maven-metadata-local.xml", "org/apache/maven/its/install/gpa1/test/maven-metadata-local.xml.md5", "org/apache/maven/its/install/gpa1/test/maven-metadata-local.xml.sha1", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.jar", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.jar.md5", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.jar.sha1", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.pom", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.pom.md5", "org/apache/maven/its/install/gpa1/test/0.1/test-0.1.pom.sha1", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) ) { System.out.println( "Verifying " + file ); Utils.verifyChecksum( file ); } } return true; maven-install-plugin-2.4/src/it/generate-pom-auto-1/pom.xml0000664000175000017500000000305411130472135023165 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.gpa1 test 1.0 jar Tests that by default a POM is generated for the installed file if no POM exists already in the local repo. org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/generate-pom-auto-1/setup.bsh0000664000175000017500000000037011130472135023504 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/gpa1" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/attach-jar-checksum/0000775000175000017500000000000012236252402021776 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/attach-jar-checksum/verify.bsh0000664000175000017500000000343411130167651024007 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.apache.maven.plugin.install.*; String[] paths = { "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.md5", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.sha1", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.md5", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.sha1", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.md5", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.sha1", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/maven-metadata-local.xml.md5", "org/apache/maven/its/install/ajc/test/1.0-SNAPSHOT/maven-metadata-local.xml.sha1", "org/apache/maven/its/install/ajc/test/maven-metadata-local.xml", "org/apache/maven/its/install/ajc/test/maven-metadata-local.xml.md5", "org/apache/maven/its/install/ajc/test/maven-metadata-local.xml.sha1", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) ) { System.out.println( "Verifying " + file ); Utils.verifyChecksum( file ); } } return true; maven-install-plugin-2.4/src/it/attach-jar-checksum/pom.xml0000664000175000017500000000533611127125622023323 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.ajc test 1.0-SNAPSHOT jar Tests the installation of a simple snapshot JAR with an attached artifact and checksums true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true org.apache.maven.plugins maven-jar-plugin 2.1 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-source-plugin 2.0.4 attach-sources jar org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/attach-jar-checksum/setup.bsh0000664000175000017500000000036711127125622023643 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/ajc" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/generate-pom-auto-2/0000775000175000017500000000000012236252402021650 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/generate-pom-auto-2/test.jar0000664000175000017500000000053111130472135023323 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/generate-pom-auto-2/invoker.properties0000664000175000017500000000013611161005513025436 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file maven-install-plugin-2.4/src/it/generate-pom-auto-2/test.properties0000664000175000017500000000015411130472135024744 0ustar ebourgebourgfile = test.jar groupId = org.apache.maven.its.install.gpa2 artifactId = test version = 0.1 packaging = jar maven-install-plugin-2.4/src/it/generate-pom-auto-2/verify.bsh0000664000175000017500000000144611130472135023656 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/gpa2/test/maven-metadata-local.xml", "org/apache/maven/its/install/gpa2/test/0.1/test-0.1.jar", "org/apache/maven/its/install/gpa2/test/0.1/test-0.1.pom", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } if ( path.endsWith( ".pom" ) ) { System.out.println( "Checking for original state of " + file ); if ( file.length() != "test".length() ) { throw new Exception( "Overwritten: " + file.getAbsolutePath() ); } } } return true; maven-install-plugin-2.4/src/it/generate-pom-auto-2/pom.xml0000664000175000017500000000305411130472135023166 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.gpa2 test 1.0 jar Tests that by default no POM is generated for the installed file if already a POM exists in the local repo. org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/generate-pom-auto-2/setup.bsh0000664000175000017500000000077111130472135023512 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File groupDir = new File( localRepositoryPath, "org/apache/maven/its/install/gpa2" ); System.out.println( "Deleting " + groupDir ); FileUtils.deleteDirectory( groupDir ); File pomFile = new File( localRepositoryPath, "org/apache/maven/its/install/gpa2/test/0.1/test-0.1.pom" ); System.out.println( "Writing " + pomFile ); pomFile.getParentFile().mkdirs(); FileUtils.fileWrite( pomFile.getPath(), "UTF-8", "test" ); return true; maven-install-plugin-2.4/src/it/no-main-artifact-2/0000775000175000017500000000000012236252402021450 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/no-main-artifact-2/verify.bsh0000664000175000017500000000123111127147462023456 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/nma2/test/maven-metadata-local.xml", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/nma2/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-it.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/no-main-artifact-2/pom.xml0000664000175000017500000000621711127147462023002 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.nma2 test 1.0-SNAPSHOT jar Tests the installation of a non-POM project that has no main artifact file but only attached artifacts (see MINSTALL-18, MINSTALL-40, MINSTALL-41). This variant of the test checks the build when target/classes is existent. true org.apache.maven.plugins maven-antrun-plugin 1.1 make-output-dir verify run org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-jar-plugin 2.1 it org.apache.maven.plugins maven-install-plugin @project.version@ org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/no-main-artifact-2/setup.bsh0000664000175000017500000000037011127140110023274 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/nma2" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/jar-sources-javadoc/0000775000175000017500000000000012236252402022022 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/jar-sources-javadoc/test.jar0000664000175000017500000000053111130501557023476 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/jar-sources-javadoc/sources.jar0000664000175000017500000000053111130501557024202 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/jar-sources-javadoc/invoker.properties0000664000175000017500000000013611161005513025610 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file maven-install-plugin-2.4/src/it/jar-sources-javadoc/test.properties0000664000175000017500000000030611160533271025117 0ustar ebourgebourgfile = test.jar groupId = org.apache.maven.its.install.jsj artifactId = test version = 0.1 packaging = jar javadoc = javadoc.jar sources = sources.jar createChecksum = true updateReleaseInfo = true maven-install-plugin-2.4/src/it/jar-sources-javadoc/javadoc.jar0000664000175000017500000000053111130501557024126 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/jar-sources-javadoc/verify.bsh0000664000175000017500000000312311130501557024023 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.apache.maven.plugin.install.*; String[] paths = { "org/apache/maven/its/install/jsj/test/maven-metadata-local.xml", "org/apache/maven/its/install/jsj/test/maven-metadata-local.xml.md5", "org/apache/maven/its/install/jsj/test/maven-metadata-local.xml.sha1", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.jar", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.jar.md5", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.jar.sha1", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.pom", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.pom.md5", "org/apache/maven/its/install/jsj/test/0.1/test-0.1.pom.sha1", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-sources.jar", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-sources.jar.md5", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-sources.jar.sha1", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-javadoc.jar", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-javadoc.jar.md5", "org/apache/maven/its/install/jsj/test/0.1/test-0.1-javadoc.jar.sha1", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) ) { System.out.println( "Verifying " + file ); Utils.verifyChecksum( file ); } } return true; maven-install-plugin-2.4/src/it/jar-sources-javadoc/pom.xml0000664000175000017500000000303611130501557023341 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.jsj test 1.0 jar Tests combined installation of a JAR together with its API docs and sources (cf. MINSTALL-49). org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/jar-sources-javadoc/setup.bsh0000664000175000017500000000040311130501557023655 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File groupDir = new File( localRepositoryPath, "org/apache/maven/its/install/jsj" ); System.out.println( "Deleting " + groupDir ); FileUtils.deleteDirectory( groupDir ); return true; maven-install-plugin-2.4/src/it/local-repo-override/0000775000175000017500000000000012236252402022032 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/local-repo-override/test.jar0000664000175000017500000000053111161005513023501 0ustar ebourgebourgPK9 META-INF/PKPK9META-INF/MANIFEST.MFMLK-. K-*ϳR03r.JM,IMu +h)f&W+x%irrPK[GGPK9 META-INF/PK9[GG=META-INF/MANIFEST.MFPK}maven-install-plugin-2.4/src/it/local-repo-override/invoker.properties0000664000175000017500000000013611161005513025620 0ustar ebourgebourginvoker.goals = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file maven-install-plugin-2.4/src/it/local-repo-override/test.properties0000664000175000017500000000016611161005513025125 0ustar ebourgebourgfile = test.jar groupId = gid artifactId = test version = 0.1 packaging = jar localRepositoryPath = target/local-repo maven-install-plugin-2.4/src/it/local-repo-override/verify.bsh0000664000175000017500000000062011161005513024025 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "gid/test/0.1/test-0.1.jar", }; for ( String path : paths ) { File file = new File( new File( basedir, "target/local-repo" ), path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Existing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/local-repo-override/pom.xml0000664000175000017500000000306411161005513023345 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.lro test 1.0 jar Tests the manual installation into a different local repo than the one configured in the settings (MINSTALL-35). org.apache.maven.plugins maven-install-plugin @project.version@ maven-install-plugin-2.4/src/it/local-repo-override/setup.bsh0000664000175000017500000000032111161005513023657 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( basedir, "target" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/pom-checksum/0000775000175000017500000000000012236252402020553 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/pom-checksum/verify.bsh0000664000175000017500000000241111242277303022556 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.apache.maven.plugin.install.*; String[] paths = { "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.md5", "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.sha1", "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/maven-metadata-local.xml.md5", "org/apache/maven/its/install/pc/test/1.0-SNAPSHOT/maven-metadata-local.xml.sha1", "org/apache/maven/its/install/pc/test/maven-metadata-local.xml", "org/apache/maven/its/install/pc/test/maven-metadata-local.xml.md5", "org/apache/maven/its/install/pc/test/maven-metadata-local.xml.sha1", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } if ( file.getName().endsWith( ".md5" ) || file.getName().endsWith( ".sha1" ) ) { System.out.println( "Verifying " + file ); Utils.verifyChecksum( file ); } } return true; maven-install-plugin-2.4/src/it/pom-checksum/pom.xml0000664000175000017500000000453711127125622022102 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.pc test 1.0-SNAPSHOT pom Tests the installation of a simple snapshot POM with checksums true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 org.apache.maven.plugins maven-site-plugin 2.0-beta-5 maven-install-plugin-2.4/src/it/pom-checksum/setup.bsh0000664000175000017500000000036611127125622022417 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/pc" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/attach-release-jar/0000775000175000017500000000000012236252402021614 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/attach-release-jar/verify.bsh0000664000175000017500000000114111124702652023615 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/arj/test/maven-metadata-local.xml", "org/apache/maven/its/install/arj/test/1.0/test-1.0.pom", "org/apache/maven/its/install/arj/test/1.0/test-1.0.jar", "org/apache/maven/its/install/arj/test/1.0/test-1.0-sources.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/attach-release-jar/pom.xml0000664000175000017500000000531511124702652023137 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.arj test 1.0 jar Tests the installation of a simple release JAR with an attached artifact. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true org.apache.maven.plugins maven-jar-plugin 2.1 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-source-plugin 2.0.4 attach-sources jar org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/attach-release-jar/setup.bsh0000664000175000017500000000036711124702652023462 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/arj" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/settings.xml0000664000175000017500000000317411257425203020552 0ustar ebourgebourg it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true maven-install-plugin-2.4/src/it/skip-install/0000775000175000017500000000000012236252402020572 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/skip-install/verify.bsh0000664000175000017500000000103711776337264022617 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/skip/test/maven-metadata-local.xml", "org/apache/maven/its/install/skip/test/1.0/test-1.0.pom", "org/apache/maven/its/install/skip/test/1.0/test-1.0.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for non existence of " + file ); if ( file.isFile() ) { throw new Exception( "Existence of file: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/skip-install/pom.xml0000664000175000017500000000454711776337264022143 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.skip test 1.0 jar Tests the skip installation of a simple release JAR. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true true org.apache.maven.plugins maven-jar-plugin 2.1 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.12 maven-install-plugin-2.4/src/it/skip-install/setup.bsh0000664000175000017500000000037011776337264022452 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/skip" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/release-jar/0000775000175000017500000000000012236252402020352 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/release-jar/verify.bsh0000664000175000017500000000103011124702652022350 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/rj/test/maven-metadata-local.xml", "org/apache/maven/its/install/rj/test/1.0/test-1.0.pom", "org/apache/maven/its/install/rj/test/1.0/test-1.0.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/release-jar/pom.xml0000664000175000017500000000450511124702652021675 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.rj test 1.0 jar Tests the installation of a simple release JAR. true org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-install-plugin @project.version@ true org.apache.maven.plugins maven-jar-plugin 2.1 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/release-jar/setup.bsh0000664000175000017500000000036611124702652022217 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/rj" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/non-default-pom/0000775000175000017500000000000012236252402021165 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/non-default-pom/verify.bsh0000664000175000017500000000110211135450117023161 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/ndp/test/maven-metadata-local.xml", "org/apache/maven/its/install/ndp/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/ndp/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/non-default-pom/non-default-pom.xml0000664000175000017500000000340011135450117024711 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.ndp test 1.0-SNAPSHOT pom Tests the installation of a POM whose file is not named pom.xml true org.apache.maven.plugins maven-install-plugin @project.version@ org.apache.maven.plugins maven-site-plugin 2.0-beta-5 maven-install-plugin-2.4/src/it/non-default-pom/setup.bsh0000664000175000017500000000036711135450117023031 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/ndp" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/it/no-main-artifact-1/0000775000175000017500000000000012236252402021447 5ustar ebourgebourgmaven-install-plugin-2.4/src/it/no-main-artifact-1/verify.bsh0000664000175000017500000000123111127147462023455 0ustar ebourgebourgimport java.io.*; import java.util.*; String[] paths = { "org/apache/maven/its/install/nma1/test/maven-metadata-local.xml", "org/apache/maven/its/install/nma1/test/1.0-SNAPSHOT/maven-metadata-local.xml", "org/apache/maven/its/install/nma1/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom", "org/apache/maven/its/install/nma1/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-it.jar", }; for ( String path : paths ) { File file = new File( localRepositoryPath, path ); System.out.println( "Checking for existence of " + file ); if ( !file.isFile() ) { throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } return true; maven-install-plugin-2.4/src/it/no-main-artifact-1/pom.xml0000664000175000017500000000623211127147462022776 0ustar ebourgebourg 4.0.0 org.apache.maven.its.install.nma1 test 1.0-SNAPSHOT jar Tests the installation of a non-POM project that has no main artifact file but only attached artifacts (see MINSTALL-18, MINSTALL-40, MINSTALL-41). This variant of the test checks the build when target/classes is non-existent. true org.apache.maven.plugins maven-antrun-plugin 1.1 delete-output-dir verify run org.apache.maven.plugins maven-compiler-plugin 2.0.2 org.apache.maven.plugins maven-jar-plugin 2.1 it org.apache.maven.plugins maven-install-plugin @project.version@ org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.3.1 maven-install-plugin-2.4/src/it/no-main-artifact-1/setup.bsh0000664000175000017500000000037011127140110023273 0ustar ebourgebourgimport java.io.*; import java.util.*; import org.codehaus.plexus.util.*; File file = new File( localRepositoryPath, "org/apache/maven/its/install/nma1" ); System.out.println( "Deleting " + file ); FileUtils.deleteDirectory( file ); return true; maven-install-plugin-2.4/src/site/0000775000175000017500000000000012236252402016510 5ustar ebourgebourgmaven-install-plugin-2.4/src/site/site.xml0000664000175000017500000000357711237116510020211 0ustar ebourgebourg maven-install-plugin-2.4/src/site/fml/0000775000175000017500000000000012236252402017266 5ustar ebourgebourgmaven-install-plugin-2.4/src/site/fml/faq.fml0000664000175000017500000000264411237116510020542 0ustar ebourgebourg Can I use the install:install-file goal to install artifacts to my remote repository?

No. You need to use deploy:deploy-file instead.

maven-install-plugin-2.4/src/site/apt/0000775000175000017500000000000012236252402017274 5ustar ebourgebourgmaven-install-plugin-2.4/src/site/apt/examples/0000775000175000017500000000000012236252402021112 5ustar ebourgebourgmaven-install-plugin-2.4/src/site/apt/examples/generic-pom-generation.apt0000664000175000017500000000336011161453751026166 0ustar ebourgebourg ---- Generating a generic POM ------ Allan Ramirez ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Generating a generic POM There are times when you do not have a POM for a 3rd party artifact. For instance, when installing a proprietary or commercial JAR into a repository. The Install Plugin can create a generic POM in this case which contains the minimal set of POM elements required by Maven, such as groupId, artifactId, version, packaging. You tell Maven to generate a POM by setting the <<>> parameter to <<>>. +---+ mvn install:install-file -Dfile=path-to-your-artifact-jar \ -DgroupId=your.groupId \ -DartifactId=your-artifactId \ -Dversion=version \ -Dpackaging=jar \ -DgeneratePom=true +---+ maven-install-plugin-2.4/src/site/apt/examples/installing-checksums.apt0000664000175000017500000000337211161453751025762 0ustar ebourgebourg ------ Creating artifact checksums ------ Allan Ramirez ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Creating artifact checksums The Install Plugin can create integrity checksums (MD5, SHA-1) for the artifacts during installation. Checksums are cryptographic hash functions and are used to check the integrity of the associated file. This can be activated by setting the <<>> parameter to <<>>. In the <<>> goal. +---+ mvn install -DcreateChecksum=true +---+ In the <<>> goal. +---+ mvn install:install-file -Dfile=path-to-your-artifact-jar \ -DgroupId=your.groupId \ -DartifactId=your-artifactId \ -Dversion=version \ -Dpackaging=jar \ -DcreateChecksum=true +---+ maven-install-plugin-2.4/src/site/apt/examples/specific-local-repo.apt0000664000175000017500000000324511161452101025436 0ustar ebourgebourg ------ Installing an artifact to a specific local repository path ------ Vincent Siveton ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Installing an artifact to a specific local repository path By default, Maven Install Plugin uses the local repository defined in the settings.xml to install an artifact. You could install an artifact on a specific local repository by setting the <<>> parameter when installing. +---+ mvn install:install-file -Dfile=path-to-your-artifact-jar \ -DgroupId=your.groupId \ -DartifactId=your-artifactId \ -Dversion=version \ -Dpackaging=jar \ -DlocalRepositoryPath=path-to-specific-local-repo +---+ maven-install-plugin-2.4/src/site/apt/examples/update-release-info.apt0000664000175000017500000000301411156474005025454 0ustar ebourgebourg ------ Updating the release information of a project ------ Allan Ramirez ------ 2009-03-13 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Updating the release information of a project Updating the release information means that a forced update of the project's metadata takes place which sets the artifact as the release version. It is most useful when installing a plugin built from source so it can be used by other projects without explicitly asking for the latest SNAPSHOT version. This can be activated by setting the <<>> parameter to <<>> when installing. +---+ mvn install -DupdateReleaseInfo=true +---+ maven-install-plugin-2.4/src/site/apt/examples/custom-pom-installation.apt0000664000175000017500000000250511161452101026416 0ustar ebourgebourg ---- Installing an artifact with a custom POM ------ Allan Ramirez ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Installing an artifact with a custom POM The Maven Install Plugin can include a pre-built custom POM with the artifact in the local repository. Just set the value of the <<>> parameter to the path of the custom POM. +---+ mvn install:install-file -Dfile=path-to-your-artifact-jar -DpomFile=path-to-pom +---+ maven-install-plugin-2.4/src/site/apt/examples/installing-secondary-artifacts.apt0000664000175000017500000000371611161453122027734 0ustar ebourgebourg ------ Installing Secondary Artifacts ------ Dennis Lundberg ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Installing Secondary Artifacts Sometimes you need to install secondary artifacts after the main artifact has been installed in your local repository. To install a secondary artifact you need to use the <<>> parameter to classify the secondary artifact. Let us assume that you want to install the sources for an old artifact, like commons-logging-1.0.3. The {{{http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.3/}central repository}} only has the main artifact and a <<<-javadoc>>> artifact for that version. Package up the sources into a JAR file on your local disk and then run the following command: +---+ mvn install:install-file -Dfile=path-to-commons-logging-sources.jar \ -DgroupId=commons-logging \ -DartifactId=commons-logging \ -Dversion=1.0.3 \ -Dpackaging=jar \ -Dclassifier=sources +---+ maven-install-plugin-2.4/src/site/apt/index.apt0000664000175000017500000001052311237116510021111 0ustar ebourgebourg ------ Introduction ------ Allan Ramirez ------ 2009-03-22 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven Install Plugin The Install Plugin is used during the <<>> phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository. The local repository is the local cache where all artifacts needed for the build are stored. By default, it is located within the user's home directory <<<(~/.m2/repository)>>> but the location can be configured in <<<~/.m2/settings.xml>>> using the <<<\>>> element. * Goals Overview The Install Plugin has 3 goals: * {{{./install-mojo.html}install:install}} is used to automatically install the project's main artifact (the JAR, WAR or EAR), its POM and any attached artifacts (sources, javadoc, etc) produced by a particular project. * {{{./install-file-mojo.html}install:install-file}} is mostly used to install an externally created artifact into the local repository, along with its POM. In that case the project information can be taken from an optionally specified pomFile, but can also be given using command line parameters. * {{{./help-mojo.html}install:help}} displays help information on maven-install-plugin. [] * Usage General instructions on how to use the Install Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/Install+Plugin}plugin's wiki page}}. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples To provide you with better understanding on some usages of the Maven Install Plugin, you can take a look into the following examples: * {{{./examples/custom-pom-installation.html}Installing a Custom POM}} * {{{./examples/generic-pom-generation.html}Generating a Generic POM}} * {{{./examples/installing-checksums.html}Creating Checksums}} * {{{./examples/update-release-info.html}Updating Release Info}} * {{{./examples/specific-local-repo.html}Installing an Artifact to a Specific Local Repository Path}} * {{{./examples/installing-secondary-artifacts.html}Installing Secondary Artifacts}} [] maven-install-plugin-2.4/src/site/apt/usage.apt0000664000175000017500000000542511237116510021113 0ustar ebourgebourg ------ Usage ------ Allan Ramirez ------ 2009-03-13 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage * The <<>> goal In most cases, <<>> goal doesn't need any configuration, it needs the project's POM and the artifact file to be installed during the <<>> phase of the default build lifecycle. +---+ mvn install +---+ * The <<>> goal The <<>> goal is used primarily for installing artifacts to the local repository which were not built by Maven. The project's development team may or may not provide a POM for the artifact. Here's a list of some of the available parameters for the <<>> goal: +---+ mvn install:install-file -Dfile=your-artifact-1.0.jar \ [-DpomFile=your-pom.xml] \ [-Dsources=src.jar] \ [-Djavadoc=apidocs.jar] \ [-DgroupId=org.some.group] \ [-DartifactId=your-artifact] \ [-Dversion=1.0] \ [-Dpackaging=jar] \ [-Dclassifier=sources] \ [-DgeneratePom=true] \ [-DcreateChecksum=true] +---+ * the groupId, artifactId, version and packaging of the file to install. These can be taken from the specified pomFile, and overridden or specified using the command line. When the pomFile contains a section, the parent's groupId can be considered if the groupId is not specified further for the current project or on the command line. * the optional <<>> parameter can be used to {{{./examples/installing-secondary-artifacts.html}install secondary artifacts}} for a project, like a <<>> or <<>> JAR. If a classifier is not given, Maven assumes the file is the main artifact for the project. maven-install-plugin-2.4/src/test/0000775000175000017500000000000012236252402016523 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/0000775000175000017500000000000012236252402017444 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/0000775000175000017500000000000012236252402020233 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/apache/0000775000175000017500000000000012236252402021454 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/apache/maven/0000775000175000017500000000000012236252402022562 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/0000775000175000017500000000000012236252402024060 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/0000775000175000017500000000000012236252402025526 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java0000664000175000017500000002547311776337222031513 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.install.stubs.AttachedArtifactStub0; import org.apache.maven.plugin.install.stubs.InstallArtifactStub; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Allan Ramirez */ public class InstallMojoTest extends AbstractMojoTestCase { InstallArtifactStub artifact; private final String LOCAL_REPO = "target/local-repo/"; public void setUp() throws Exception { super.setUp(); System.out.println( ">>>Cleaning local repo " + getBasedir() + "/" + LOCAL_REPO + "..." ); FileUtils.deleteDirectory( new File( getBasedir() + "/" + LOCAL_REPO ) ); } public void testInstallTestEnvironment() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); } public void testBasicInstall() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); File file = new File( getBasedir(), "target/test-classes/unit/basic-install-test/target/" + "maven-install-test-1.0-SNAPSHOT.jar" ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); artifact.setFile( file ); mojo.execute(); String groupId = dotToSlashReplacer( artifact.getGroupId() ); String packaging = getVariableValueFromObject( mojo, "packaging" ).toString(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + packaging ); assertTrue( installedArtifact.exists() ); } public void testBasicInstallWithAttachedArtifacts() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test-with-attached-artifacts/" + "plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); List attachedArtifacts = (ArrayList) getVariableValueFromObject( mojo, "attachedArtifacts" ); mojo.execute(); String packaging = getVariableValueFromObject( mojo, "packaging" ).toString(); String groupId = ""; for ( Iterator iter = attachedArtifacts.iterator(); iter.hasNext(); ) { AttachedArtifactStub0 attachedArtifact = (AttachedArtifactStub0) iter.next(); groupId = dotToSlashReplacer( attachedArtifact.getGroupId() ); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + attachedArtifact.getArtifactId() + "/" + attachedArtifact.getVersion() + "/" + attachedArtifact.getArtifactId() + "-" + attachedArtifact.getVersion() + "." + packaging ); assertTrue( installedArtifact.exists() ); } } public void testUpdateReleaseParamSetToTrue() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/configured-install-test/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); File file = new File( getBasedir(), "target/test-classes/unit/configured-install-test/target/" + "maven-install-test-1.0-SNAPSHOT.jar" ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); artifact.setFile( file ); mojo.execute(); assertTrue( artifact.isRelease() ); } public void testInstallIfArtifactFileIsNull() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); artifact.setFile( null ); assertNull( artifact.getFile() ); try { mojo.execute(); fail( "Did not throw mojo execution exception" ); } catch ( MojoExecutionException e ) { //expected } } public void testInstallIfPackagingIsPom() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test-packaging-pom/" + "plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); String packaging = (String) getVariableValueFromObject( mojo, "packaging" ); assertEquals( "pom", packaging ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); mojo.execute(); String groupId = dotToSlashReplacer( artifact.getGroupId() ); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + "jar" ); assertTrue( installedArtifact.exists() ); } public void testBasicInstallAndCreateChecksumIsTrue() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-checksum/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); File file = new File( getBasedir(), "target/test-classes/unit/basic-install-checksum/" + "maven-test-jar.jar" ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); boolean createChecksum = ( (Boolean) getVariableValueFromObject( mojo, "createChecksum" ) ).booleanValue(); assertTrue( createChecksum ); artifact.setFile( file ); mojo.execute(); ArtifactMetadata metadata = null; for ( Iterator iter = artifact.getMetadataList().iterator(); iter.hasNext(); ) { metadata = (ArtifactMetadata) iter.next(); if ( metadata.getRemoteFilename().endsWith( "pom" ) ) { break; } } ArtifactRepository localRepo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" ); File pom = new File( localRepo.getBasedir(), localRepo.pathOfLocalRepositoryMetadata( metadata, localRepo ) ); assertTrue( pom.exists() ); //get the actual checksum of the pom String actualPomMd5Sum = mojo.md5Digester.calc( pom ); String actualPomSha1Sum = mojo.sha1Digester.calc( pom ); //get the actual checksum of the artifact String actualMd5Sum = mojo.md5Digester.calc( file ); String actualSha1Sum = mojo.sha1Digester.calc( file ); String groupId = dotToSlashReplacer( artifact.getGroupId() ); String packaging = getVariableValueFromObject( mojo, "packaging" ).toString(); String localPath = getBasedir() + "/" + LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion(); File installedArtifact = new File( localPath + "." + packaging ); File pomMd5 = new File( localPath + ".pom.md5" ); File pomSha1 = new File( localPath + ".pom.sha1" ); File md5 = new File( localPath + "." + packaging + ".md5" ); File sha1 = new File( localPath + "." + packaging + ".sha1" ); assertTrue( pomMd5.exists() ); assertTrue( pomSha1.exists() ); assertTrue( md5.exists() ); assertTrue( sha1.exists() ); String generatedMd5 = FileUtils.fileRead( md5, "UTF-8" ); String generatedSha1 = FileUtils.fileRead( sha1, "UTF-8" ); String generatedPomMd5 = FileUtils.fileRead( pomMd5, "UTF-8" ); String generatedPomSha1 = FileUtils.fileRead( pomSha1, "UTF-8" ); assertEquals( actualMd5Sum, generatedMd5 ); assertEquals( actualSha1Sum, generatedSha1 ); assertEquals( actualPomMd5Sum, generatedPomMd5 ); assertEquals( actualPomSha1Sum, generatedPomSha1 ); assertTrue( installedArtifact.exists() ); } public void testSkip() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test/plugin-config.xml" ); InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom ); assertNotNull( mojo ); File file = new File( getBasedir(), "target/test-classes/unit/basic-install-test/target/" + "maven-install-test-1.0-SNAPSHOT.jar" ); artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" ); artifact.setFile( file ); mojo.setSkip(true); mojo.execute(); String groupId = dotToSlashReplacer( artifact.getGroupId() ); String packaging = getVariableValueFromObject( mojo, "packaging" ).toString(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" + artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + packaging ); assertFalse( installedArtifact.exists() ); } private String dotToSlashReplacer( String parameter ) { return parameter.replace( '.', '/' ); } } maven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/Utils.java0000664000175000017500000000437711127125622027505 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.Md5Digester; import org.codehaus.plexus.digest.Sha1Digester; import org.codehaus.plexus.util.FileUtils; /** * A utility class to assist testing. * * @author Benjamin Bentmann * @version $Id: Utils.java 730530 2009-01-01 11:40:02Z bentmann $ */ public class Utils { /** * Verifies a checksum file in the local repo. * * @param checksumFile The checksum file to verify, must not be null. * @throws Exception If the verification failed. */ public static void verifyChecksum( File checksumFile ) throws Exception { File dataFile; Digester digester; if ( checksumFile.getName().endsWith( ".md5" ) ) { digester = new Md5Digester(); dataFile = new File( checksumFile.getPath().substring( 0, checksumFile.getPath().length() - 4 ) ); } else if ( checksumFile.getName().endsWith( ".sha1" ) ) { digester = new Sha1Digester(); dataFile = new File( checksumFile.getPath().substring( 0, checksumFile.getPath().length() - 5 ) ); } else { throw new IllegalArgumentException( "Unsupported checksum file: " + checksumFile ); } String expected = FileUtils.fileRead( checksumFile, "UTF-8" ); digester.verify( dataFile, expected ); } } maven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/InstallFileMojoTest.java0000664000175000017500000002252711161005702032267 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import java.io.File; import java.io.Reader; /** * @author Allan Ramirez */ public class InstallFileMojoTest extends AbstractMojoTestCase { private String groupId; private String legacyGroupId; private String artifactId; private String version; private String packaging; private String classifier; private File file; private final String LOCAL_REPO = "target/local-repo/"; public void setUp() throws Exception { super.setUp(); FileUtils.deleteDirectory( new File( getBasedir() + "/" + LOCAL_REPO ) ); } public void testInstallFileTestEnvironment() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-basic-test/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); } public void testBasicInstallFile() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-basic-test/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); mojo.execute(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + packaging ); assertTrue( installedArtifact.exists() ); } public void testLayoutInstallFile() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-layout-test/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); mojo.setLocalRepositoryPath( new File( getBasedir(), LOCAL_REPO ) ); mojo.execute(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + legacyGroupId + "/" + "jars" + "/" + artifactId + "-" + version + "." + packaging ); assertTrue( installedArtifact.exists() ); } public void testInstallFileWithClassifier() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-with-classifier/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); assertNotNull( classifier ); mojo.execute(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "-" + classifier + "." + packaging ); assertTrue( installedArtifact.exists() ); } public void testInstallFileWithGeneratePom() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-test-generatePom/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); mojo.execute(); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + packaging ); assertTrue( ( (Boolean) getVariableValueFromObject( mojo, "generatePom" ) ).booleanValue() ); assertTrue( installedArtifact.exists() ); File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + "pom" ); Model model; Reader reader = null; try { reader = ReaderFactory.newXmlReader( installedPom ); model = new MavenXpp3Reader().read( reader ); } finally { IOUtil.close( reader ); } assertEquals( "4.0.0", model.getModelVersion() ); assertEquals( (String) getVariableValueFromObject( mojo, "groupId" ), model.getGroupId() ); assertEquals( artifactId, model.getArtifactId() ); assertEquals( version, model.getVersion() ); } public void testInstallFileWithPomFile() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-with-pomFile-test/plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); mojo.execute(); File pomFile = (File) getVariableValueFromObject( mojo, "pomFile" ); assertTrue( pomFile.exists() ); File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + packaging ); assertTrue( installedArtifact.exists() ); File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + "pom" ); assertTrue( installedPom.exists() ); } public void testInstallFileWithPomAsPackaging() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-with-pom-as-packaging/" + "plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); assertTrue( file.exists() ); assertEquals( "pom", packaging ); mojo.execute(); File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + "pom" ); assertTrue( installedPom.exists() ); } public void testInstallFileWithChecksum() throws Exception { File testPom = new File( getBasedir(), "target/test-classes/unit/install-file-with-checksum/" + "plugin-config.xml" ); InstallFileMojo mojo = (InstallFileMojo) lookupMojo( "install-file", testPom ); assertNotNull( mojo ); assignValuesForParameter( mojo ); boolean createChecksum = ( (Boolean) getVariableValueFromObject( mojo, "createChecksum" ) ).booleanValue(); assertTrue( createChecksum ); mojo.execute(); //get the actual checksum of the artifact String actualMd5Sum = mojo.md5Digester.calc( file ); String actualSha1Sum = mojo.sha1Digester.calc( file ); String localPath = getBasedir() + "/" + LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version; File installedArtifact = new File( localPath + "." + "jar" ); File md5 = new File( localPath + ".jar.md5" ); File sha1 = new File( localPath + ".jar.sha1" ); assertTrue( md5.exists() ); assertTrue( sha1.exists() ); String generatedMd5 = FileUtils.fileRead( md5, "UTF-8" ); String generatedSha1 = FileUtils.fileRead( sha1, "UTF-8" ); assertEquals( actualMd5Sum, generatedMd5 ); assertEquals( actualSha1Sum, generatedSha1 ); assertTrue( installedArtifact.exists() ); } private void assignValuesForParameter( Object obj ) throws Exception { this.groupId = dotToSlashReplacer( (String) getVariableValueFromObject( obj, "groupId" ) ); this.legacyGroupId = (String) getVariableValueFromObject( obj, "groupId" ); this.artifactId = (String) getVariableValueFromObject( obj, "artifactId" ); this.version = (String) getVariableValueFromObject( obj, "version" ); this.packaging = (String) getVariableValueFromObject( obj, "packaging" ); this.classifier = (String) getVariableValueFromObject( obj, "classifier" ); this.file = (File) getVariableValueFromObject( obj, "file" ); } private String dotToSlashReplacer( String parameter ) { return parameter.replace( '.', '/' ); } } maven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/0000775000175000017500000000000012236252402026666 5ustar ebourgebourg././@LongLink0000644000000000000000000000015012236252402011634 Lustar rootrootmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/AttachedArtifactStub1.javamaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/AttachedArtifactStub1.j0000664000175000017500000000177211123544663033171 0ustar ebourgebourgpackage org.apache.maven.plugin.install.stubs; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ public class AttachedArtifactStub1 extends AttachedArtifactStub0 { public String getArtifactId() { return "attached-artifact-test-1"; } } ././@LongLink0000644000000000000000000000015012236252402011634 Lustar rootrootmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/AttachedArtifactStub0.javamaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/AttachedArtifactStub0.j0000664000175000017500000000243611123544663033166 0ustar ebourgebourgpackage org.apache.maven.plugin.install.stubs; import java.io.File; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ public class AttachedArtifactStub0 extends InstallArtifactStub { public String getArtifactId() { return "attached-artifact-test-0"; } public File getFile() { return new File( System.getProperty( "basedir" ), "target/test-classes/unit/basic-install-test-with-attached-artifacts/" + "target/maven-install-test-1.0-SNAPSHOT.jar" ); } } ././@LongLink0000644000000000000000000000014612236252402011641 Lustar rootrootmaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.javamaven-install-plugin-2.4/src/test/java/org/apache/maven/plugin/install/stubs/InstallArtifactStub.jav0000664000175000017500000000532711123544663033330 0ustar ebourgebourgpackage org.apache.maven.plugin.install.stubs; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.plugin.testing.stubs.ArtifactStub; import java.io.File; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; public class InstallArtifactStub extends ArtifactStub { private Map metadataMap; private File file; private boolean release; public String getArtifactId() { return "maven-install-test"; } public String getGroupId() { return "org.apache.maven.test"; } public String getVersion() { return "1.0-SNAPSHOT"; } public String getBaseVersion() { return getVersion(); } public void setFile( File file ) { this.file = file; } public File getFile() { return file; } public ArtifactHandler getArtifactHandler() { return new DefaultArtifactHandler() { public String getExtension() { return "jar"; } }; } public void addMetadata( ArtifactMetadata metadata ) { if ( metadataMap == null ) { metadataMap = new HashMap(); } ArtifactMetadata m = (ArtifactMetadata) metadataMap.get( metadata.getKey() ); if ( m != null ) { m.merge( metadata ); } else { metadataMap.put( metadata.getKey(), metadata ); } } public Collection getMetadataList() { return metadataMap == null ? Collections.EMPTY_LIST : metadataMap.values(); } public boolean isRelease() { return release; } public void setRelease( boolean release ) { this.release = release; } } maven-install-plugin-2.4/src/test/resources/0000775000175000017500000000000012236252402020535 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/0000775000175000017500000000000012236252402021514 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pomFile-test/0000775000175000017500000000000012236252402027416 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pomFile-test/plugin-config.xml0000664000175000017500000000576610712314063032716 0ustar ebourgebourg<?xml version="1.0" encoding="UTF-16"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project> <build> <plugins> <plugin> <artifactId>maven-install-plugin</artifactId> <configuration> <groupId>org.apache.maven.test</groupId> <artifactId>maven-install-file-test</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <file> ${basedir}/src/test/resources/unit/install-file-with-pomFile-test/target/maven-install-test-1.0-SNAPSHOT.jar </file> <pomFile>${basedir}/src/test/resources/unit/install-file-with-pomFile-test/plugin-config.xml</pomFile> <localRepository>${localRepository}</localRepository> </configuration> </plugin> </plugins> </build> </project>maven-install-plugin-2.4/src/test/resources/unit/install-file-with-pomFile-test/target/0000775000175000017500000000000012236252402030704 5ustar ebourgebourg././@LongLink0000644000000000000000000000017312236252402011641 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pomFile-test/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pomFile-test/target/maven-install0000664000175000017500000000450410415144167033411 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/0000775000175000017500000000000012236252402031720 5ustar ebourgebourg././@LongLink0000644000000000000000000000015612236252402011642 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/plugin-config.xmlmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/plugin-c0000664000175000017500000000305610771725502033375 0ustar ebourgebourg maven-install-plugin ${basedir}/src/test/resources/unit/basic-install-test-with-attached-artifacts/plugin-config.xml jar ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/target/0000775000175000017500000000000012236252402033206 5ustar ebourgebourg././@LongLink0000644000000000000000000000020712236252402011637 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test-with-attached-artifacts/target/m0000664000175000017500000000450410414662047033376 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/install-file-layout-test/0000775000175000017500000000000012236252402026367 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-layout-test/plugin-config.xml0000664000175000017500000000260411161005702031647 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT jar legacy ${basedir}/src/test/resources/unit/install-file-basic-test/target/maven-install-test-1.0-SNAPSHOT.jar ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/install-file-layout-test/target/0000775000175000017500000000000012236252402027655 5ustar ebourgebourg././@LongLink0000644000000000000000000000016512236252402011642 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-layout-test/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-layout-test/target/maven-install-test-0000664000175000017500000000450410616241020033401 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/install-file-with-checksum/0000775000175000017500000000000012236252402026650 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-checksum/plugin-config.xml0000664000175000017500000000261010771725502032142 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT jar ${basedir}/src/test/resources/unit/install-file-with-checksum/maven-test-jar.jar ${localRepository} true true maven-install-plugin-2.4/src/test/resources/unit/install-file-with-checksum/maven-test-jar.jar0000664000175000017500000000002710435257266032216 0ustar ebourgebourgthis is just a test jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-classifier/0000775000175000017500000000000012236252402027172 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-classifier/plugin-config.xml0000664000175000017500000000261310623744422032465 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT jar sources ${basedir}/src/test/resources/unit/install-file-with-classifier/target/maven-install-test-1.0-SNAPSHOT.jar ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/install-file-with-classifier/target/0000775000175000017500000000000012236252402030460 5ustar ebourgebourg././@LongLink0000644000000000000000000000017112236252402011637 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-classifier/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-classifier/target/maven-install-t0000664000175000017500000000450410454007546033430 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/basic-install-test/0000775000175000017500000000000012236252402025216 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test/plugin-config.xml0000664000175000017500000000242310771725502030512 0ustar ebourgebourg maven-install-plugin ${basedir}/src/test/resources/unit/basic-install-test/plugin-config.xml jar ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/basic-install-test/target/0000775000175000017500000000000012236252402026504 5ustar ebourgebourg././@LongLink0000644000000000000000000000015712236252402011643 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test/target/maven-install-test-1.0-SN0000664000175000017500000000450410414636340032776 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/install-file-test-generatePom/0000775000175000017500000000000012236252402027320 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-test-generatePom/plugin-config.xml0000664000175000017500000000261310771725502032615 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT jar ${basedir}/src/test/resources/unit/install-file-test-generatePom/target/maven-install-test-1.0-SNAPSHOT.jar true ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/install-file-test-generatePom/target/0000775000175000017500000000000012236252402030606 5ustar ebourgebourg././@LongLink0000644000000000000000000000017212236252402011640 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-test-generatePom/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-test-generatePom/target/maven-install-0000664000175000017500000000450410415075074033370 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/basic-install-test-packaging-pom/0000775000175000017500000000000012236252402027731 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/basic-install-test-packaging-pom/plugin-config.xml0000664000175000017500000000244110771725502033225 0ustar ebourgebourg maven-install-plugin ${basedir}/src/test/resources/unit/basic-install-test-packaging-pom/plugin-config.xml pom ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/install-file-basic-test/0000775000175000017500000000000012236252402026133 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/install-file-basic-test/plugin-config.xml0000664000175000017500000000251610771725502031432 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT jar ${basedir}/src/test/resources/unit/install-file-basic-test/target/maven-install-test-1.0-SNAPSHOT.jar ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/install-file-basic-test/target/0000775000175000017500000000000012236252402027421 5ustar ebourgebourg././@LongLink0000644000000000000000000000016412236252402011641 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-basic-test/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/install-file-basic-test/target/maven-install-test-10000664000175000017500000000450410415075074033241 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/configured-install-test/0000775000175000017500000000000012236252402026262 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/configured-install-test/plugin-config.xml0000664000175000017500000000251610771725502031561 0ustar ebourgebourg maven-install-plugin ${basedir}/src/test/resources/unit/configured-install-test/plugin-config.xml jar true ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/configured-install-test/target/0000775000175000017500000000000012236252402027550 5ustar ebourgebourg././@LongLink0000644000000000000000000000016412236252402011641 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/configured-install-test/target/maven-install-test-1.0-SNAPSHOT.jarmaven-install-plugin-2.4/src/test/resources/unit/configured-install-test/target/maven-install-test-10000664000175000017500000000450410414662361033370 0ustar ebourgebourgPK eR4 META-INF/PK dR4&VMETA-INF/MANIFEST.MFO 0dtFP&(/nSOEQ]_)U7t^6q,umt_Ҹ^|%a=$E!enh{c+ PJ0! zZ='qv2F$cH=uVpPK cR4org/PK cR4 org/apache/PK cR4org/apache/maven/PK cR4org/apache/maven/test/PK cR4 ?1 org/apache/maven/test/Test.classuQN1=qx>M؁00q5Q24P2!YąGo'.4ܞs=E4@ v,`{>}0.Vl*nNIBJ3bQC'̌璧b#5re` r#'^,FQqmH1:8 Co33~?Y4|\Yղ52`CkHx?dXi$1آGuQU+ĮQP={{FY|DBa> MjnW˻_PK eR4META-INF/maven/PK eR4%META-INF/maven/org.apache.maven.test/PK eR48META-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlU 0EC p+Tim7W]>I$ڦ`q/*DRN9[tp GySt,M*&`LC 發\l('qwX^KX-& ~6<PK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesSvOK-J,IMQHTM,KRr  L - ,C xR3l t=CxҋK META-INF/maven/org.apache.maven.test/PK eR48AMETA-INF/maven/org.apache.maven.test/maven-install-test/PK ZR4?META-INF/maven/org.apache.maven.test/maven-install-test/pom.xmlPK eR4*-k~FMETA-INF/maven/org.apache.maven.test/maven-install-test/pom.propertiesPK maven-install-plugin-2.4/src/test/resources/unit/install-file-with-pom-as-packaging/0000775000175000017500000000000012236252402030164 5ustar ebourgebourg././@LongLink0000644000000000000000000000014612236252402011641 Lustar rootrootmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pom-as-packaging/plugin-config.xmlmaven-install-plugin-2.4/src/test/resources/unit/install-file-with-pom-as-packaging/plugin-config.xm0000664000175000017500000000246110771725502033306 0ustar ebourgebourg maven-install-plugin org.apache.maven.test maven-install-file-test 1.0-SNAPSHOT pom ${basedir}/src/test/resources/unit/install-file-with-pomFile-test/plugin-config.xml ${localRepository} maven-install-plugin-2.4/src/test/resources/unit/basic-install-checksum/0000775000175000017500000000000012236252402026041 5ustar ebourgebourgmaven-install-plugin-2.4/src/test/resources/unit/basic-install-checksum/plugin-config.xml0000664000175000017500000000250710771725502031340 0ustar ebourgebourg maven-install-plugin ${basedir}/src/test/resources/unit/basic-install-checksum/plugin-config.xml jar ${localRepository} true maven-install-plugin-2.4/src/test/resources/unit/basic-install-checksum/maven-test-jar.jar0000664000175000017500000000002710435257266031407 0ustar ebourgebourgthis is just a test jarmaven-install-plugin-2.4/src/main/0000775000175000017500000000000012236252402016470 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/0000775000175000017500000000000012236252402017411 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/0000775000175000017500000000000012236252402020200 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/apache/0000775000175000017500000000000012236252402021421 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/apache/maven/0000775000175000017500000000000012236252402022527 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/apache/maven/plugin/0000775000175000017500000000000012236252402024025 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/apache/maven/plugin/install/0000775000175000017500000000000012236252402025473 5ustar ebourgebourgmaven-install-plugin-2.4/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java0000664000175000017500000002101211773060533032260 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.installer.ArtifactInstaller; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.DigesterException; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Iterator; /** * Common fields for installation mojos. * * @author Brett Porter * @version $Id: AbstractInstallMojo.java 1355014 2012-06-28 13:51:23Z olamy $ */ public abstract class AbstractInstallMojo extends AbstractMojo { /** */ @Component protected ArtifactFactory artifactFactory; /** */ @Component protected ArtifactInstaller installer; /** */ @Parameter( property = "localRepository", required = true, readonly = true ) protected ArtifactRepository localRepository; /** * Flag whether to create checksums (MD5, SHA-1) or not. * * @since 2.2 */ @Parameter( property = "createChecksum", defaultValue = "false" ) protected boolean createChecksum; /** * Whether to update the metadata to make the artifact a release version. */ @Parameter( property = "updateReleaseInfo", defaultValue = "false" ) protected boolean updateReleaseInfo; /** * Digester for MD5. */ @Component( hint = "md5" ) protected Digester md5Digester; /** * Digester for SHA-1. */ @Component( hint = "sha1" ) protected Digester sha1Digester; /** * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist * (yet). * * @param artifact The artifact whose local repo path should be determined, must not be null. * @return The absolute path to the artifact when installed, never null. */ protected File getLocalRepoFile( Artifact artifact ) { String path = localRepository.pathOf( artifact ); return new File( localRepository.getBasedir(), path ); } /** * Gets the path of the specified artifact metadata within the local repository. Note that the returned path need * not exist (yet). * * @param metadata The artifact metadata whose local repo path should be determined, must not be null. * @return The absolute path to the artifact metadata when installed, never null. */ protected File getLocalRepoFile( ArtifactMetadata metadata ) { String path = localRepository.pathOfLocalRepositoryMetadata( metadata, localRepository ); return new File( localRepository.getBasedir(), path ); } /** * Installs the checksums for the specified artifact if this has been enabled in the plugin configuration. This * method creates checksums for files that have already been installed to the local repo to account for on-the-fly * generated/updated files. For example, in Maven 2.0.4- the ProjectArtifactMetadata did not install * the original POM file (cf. MNG-2820). While the plugin currently requires Maven 2.0.6, we continue to hash the * installed POM for robustness with regard to future changes like re-introducing some kind of POM filtering. * * @param artifact The artifact for which to create checksums, must not be null. * @param metadataFiles The set where additional metadata files will be registered for later checksum installation, * must not be null. * @throws MojoExecutionException If the checksums could not be installed. */ protected void installChecksums( Artifact artifact, Collection metadataFiles ) throws MojoExecutionException { if ( !createChecksum ) { return; } File artifactFile = getLocalRepoFile( artifact ); installChecksums( artifactFile ); Collection metadatas = artifact.getMetadataList(); if ( metadatas != null ) { for ( Iterator it = metadatas.iterator(); it.hasNext(); ) { ArtifactMetadata metadata = (ArtifactMetadata) it.next(); File metadataFile = getLocalRepoFile( metadata ); metadataFiles.add( metadataFile ); } } } /** * Installs the checksums for the specified metadata files. * * @param metadataFiles The collection of metadata files to install checksums for, must not be null. * @throws MojoExecutionException If the checksums could not be installed. */ protected void installChecksums( Collection metadataFiles ) throws MojoExecutionException { for ( Iterator it = metadataFiles.iterator(); it.hasNext(); ) { File metadataFile = (File) it.next(); installChecksums( metadataFile ); } } /** * Installs the checksums for the specified file (if it exists). * * @param installedFile The path to the already installed file in the local repo for which to generate checksums, * must not be null. * @throws MojoExecutionException If the checksums could not be installed. */ private void installChecksums( File installedFile ) throws MojoExecutionException { boolean signatureFile = installedFile.getName().endsWith( ".asc" ); if ( installedFile.isFile() && !signatureFile ) { installChecksum( installedFile, installedFile, md5Digester, ".md5" ); installChecksum( installedFile, installedFile, sha1Digester, ".sha1" ); } } /** * Installs a checksum for the specified file. * * @param originalFile The path to the file from which the checksum is generated, must not be null. * @param installedFile The base path from which the path to the checksum files is derived by appending the given * file extension, must not be null. * @param digester The checksum algorithm to use, must not be null. * @param ext The file extension (including the leading dot) to use for the checksum file, must not be * null. * @throws MojoExecutionException If the checksum could not be installed. */ private void installChecksum( File originalFile, File installedFile, Digester digester, String ext ) throws MojoExecutionException { String checksum; getLog().debug( "Calculating " + digester.getAlgorithm() + " checksum for " + originalFile ); try { checksum = digester.calc( originalFile ); } catch ( DigesterException e ) { throw new MojoExecutionException( "Failed to calculate " + digester.getAlgorithm() + " checksum for " + originalFile, e ); } File checksumFile = new File( installedFile.getAbsolutePath() + ext ); getLog().debug( "Installing checksum to " + checksumFile ); try { checksumFile.getParentFile().mkdirs(); FileUtils.fileWrite( checksumFile.getAbsolutePath(), "UTF-8", checksum ); } catch ( IOException e ) { throw new MojoExecutionException( "Failed to install checksum to " + checksumFile, e ); } } } maven-install-plugin-2.4/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java0000664000175000017500000003513012005571022031367 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.model.Model; import org.apache.maven.model.Parent; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.artifact.ProjectArtifactMetadata; import org.apache.maven.project.validation.ModelValidationResult; import org.apache.maven.project.validation.ModelValidator; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.net.MalformedURLException; import java.util.Collection; import java.util.LinkedHashSet; import java.util.Map; /** * Installs a file in the local repository. * * @author Brett Porter * @version $Id: InstallFileMojo.java 1367287 2012-07-30 20:44:02Z olamy $ */ @Mojo( name = "install-file", requiresProject = false, aggregator = true, threadSafe = true ) public class InstallFileMojo extends AbstractInstallMojo { /** * GroupId of the artifact to be installed. Retrieved from POM file if one is specified. */ @Parameter( property = "groupId" ) protected String groupId; /** * ArtifactId of the artifact to be installed. Retrieved from POM file if one is specified. */ @Parameter( property = "artifactId" ) protected String artifactId; /** * Version of the artifact to be installed. Retrieved from POM file if one is specified. */ @Parameter( property = "version" ) protected String version; /** * Packaging type of the artifact to be installed. Retrieved from POM file if one is specified. */ @Parameter( property = "packaging" ) protected String packaging; /** * Classifier type of the artifact to be installed. For example, "sources" or "javadoc". Defaults to none which * means this is the project's main artifact. * * @since 2.2 */ @Parameter( property = "classifier" ) protected String classifier; /** * The file to be installed in the local repository. */ @Parameter( property = "file", required = true ) private File file; /** * The bundled API docs for the artifact. * * @since 2.3 */ @Parameter( property = "javadoc" ) private File javadoc; /** * The bundled sources for the artifact. * * @since 2.3 */ @Parameter( property = "sources" ) private File sources; /** * Location of an existing POM file to be installed alongside the main artifact, given by the {@link #file} * parameter. * * @since 2.1 */ @Parameter( property = "pomFile" ) private File pomFile; /** * Generate a minimal POM for the artifact if none is supplied via the parameter {@link #pomFile}. Defaults to * true if there is no existing POM in the local repository yet. * * @since 2.1 */ @Parameter( property = "generatePom" ) private Boolean generatePom; /** * The type of remote repository layout to install to. Try legacy for a Maven 1.x-style repository * layout. * * @since 2.2 */ @Parameter( property = "repositoryLayout", defaultValue = "default", required = true ) private String repositoryLayout; /** * Map that contains the repository layouts. */ @Component( role = ArtifactRepositoryLayout.class ) private Map repositoryLayouts; /** * The path for a specific local repository directory. If not specified the local repository path configured in the * Maven settings will be used. * * @since 2.2 */ @Parameter( property = "localRepositoryPath" ) private File localRepositoryPath; /** * The component used to validate the user-supplied artifact coordinates. */ @Component private ModelValidator modelValidator; /** * @see org.apache.maven.plugin.Mojo#execute() */ public void execute() throws MojoExecutionException, MojoFailureException { if ( !file.exists() ) { String message = "The specified file '" + file.getPath() + "' not exists"; getLog().error( message ); throw new MojoFailureException( message ); } // ---------------------------------------------------------------------- // Override the default localRepository variable // ---------------------------------------------------------------------- if ( localRepositoryPath != null ) { try { ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) repositoryLayouts.get( repositoryLayout ); getLog().debug( "Layout: " + layout.getClass() ); localRepository = new DefaultArtifactRepository( localRepository.getId(), localRepositoryPath.toURL().toString(), layout ); } catch ( MalformedURLException e ) { throw new MojoExecutionException( "MalformedURLException: " + e.getMessage(), e ); } } if ( pomFile != null ) { processModel( readModel( pomFile ) ); } validateArtifactInformation(); Artifact artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, classifier ); if ( file.equals( getLocalRepoFile( artifact ) ) ) { throw new MojoFailureException( "Cannot install artifact. " + "Artifact is already in the local repository.\n\nFile in question is: " + file + "\n" ); } File generatedPomFile = null; if ( !"pom".equals( packaging ) ) { if ( pomFile != null ) { ArtifactMetadata pomMetadata = new ProjectArtifactMetadata( artifact, pomFile ); artifact.addMetadata( pomMetadata ); } else { generatedPomFile = generatePomFile(); ArtifactMetadata pomMetadata = new ProjectArtifactMetadata( artifact, generatedPomFile ); if ( Boolean.TRUE.equals( generatePom ) || ( generatePom == null && !getLocalRepoFile( pomMetadata ).exists() ) ) { getLog().debug( "Installing generated POM" ); artifact.addMetadata( pomMetadata ); } else if ( generatePom == null ) { getLog().debug( "Skipping installation of generated POM, already present in local repository" ); } } } if ( updateReleaseInfo ) { artifact.setRelease( true ); } Collection metadataFiles = new LinkedHashSet(); // TODO: maybe not strictly correct, while we should enforce that packaging has a type handler of the same id, // we don't try { installer.install( file, artifact, localRepository ); installChecksums( artifact, metadataFiles ); } catch ( ArtifactInstallationException e ) { throw new MojoExecutionException( "Error installing artifact '" + artifact.getDependencyConflictId() + "': " + e.getMessage(), e ); } finally { if ( generatedPomFile != null ) { generatedPomFile.delete(); } } if ( sources != null ) { artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "sources" ); try { installer.install( sources, artifact, localRepository ); installChecksums( artifact, metadataFiles ); } catch ( ArtifactInstallationException e ) { throw new MojoExecutionException( "Error installing sources " + sources + ": " + e.getMessage(), e ); } } if ( javadoc != null ) { artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, "jar", "javadoc" ); try { installer.install( javadoc, artifact, localRepository ); installChecksums( artifact, metadataFiles ); } catch ( ArtifactInstallationException e ) { throw new MojoExecutionException( "Error installing API docs " + javadoc + ": " + e.getMessage(), e ); } } installChecksums( metadataFiles ); } /** * Parses a POM. * * @param pomFile The path of the POM file to parse, must not be null. * @return The model from the POM file, never null. * @throws MojoExecutionException If the POM could not be parsed. */ private Model readModel( File pomFile ) throws MojoExecutionException { Reader reader = null; try { reader = ReaderFactory.newXmlReader( pomFile ); return new MavenXpp3Reader().read( reader ); } catch ( FileNotFoundException e ) { throw new MojoExecutionException( "File not found " + pomFile, e ); } catch ( IOException e ) { throw new MojoExecutionException( "Error reading POM " + pomFile, e ); } catch ( XmlPullParserException e ) { throw new MojoExecutionException( "Error parsing POM " + pomFile, e ); } finally { IOUtil.close( reader ); } } /** * Populates missing mojo parameters from the specified POM. * * @param model The POM to extract missing artifact coordinates from, must not be null. */ private void processModel( Model model ) { Parent parent = model.getParent(); if ( this.groupId == null ) { this.groupId = model.getGroupId(); if ( this.groupId == null && parent != null ) { this.groupId = parent.getGroupId(); } } if ( this.artifactId == null ) { this.artifactId = model.getArtifactId(); } if ( this.version == null ) { this.version = model.getVersion(); if ( this.version == null && parent != null ) { this.version = parent.getVersion(); } } if ( this.packaging == null ) { this.packaging = model.getPackaging(); } } /** * Validates the user-supplied artifact information. * * @throws MojoExecutionException If any artifact coordinate is invalid. */ private void validateArtifactInformation() throws MojoExecutionException { Model model = generateModel(); ModelValidationResult result = modelValidator.validate( model ); if ( result.getMessageCount() > 0 ) { throw new MojoExecutionException( "The artifact information is incomplete or not valid:\n" + result.render( " " ) ); } } /** * Generates a minimal model from the user-supplied artifact information. * * @return The generated model, never null. */ private Model generateModel() { Model model = new Model(); model.setModelVersion( "4.0.0" ); model.setGroupId( groupId ); model.setArtifactId( artifactId ); model.setVersion( version ); model.setPackaging( packaging ); model.setDescription( "POM was created from install:install-file" ); return model; } /** * Generates a (temporary) POM file from the plugin configuration. It's the responsibility of the caller to delete * the generated file when no longer needed. * * @return The path to the generated POM file, never null. * @throws MojoExecutionException If the POM file could not be generated. */ private File generatePomFile() throws MojoExecutionException { Model model = generateModel(); Writer writer = null; try { File pomFile = File.createTempFile( "mvninstall", ".pom" ); writer = WriterFactory.newXmlWriter( pomFile ); new MavenXpp3Writer().write( writer, model ); return pomFile; } catch ( IOException e ) { throw new MojoExecutionException( "Error writing temporary POM file: " + e.getMessage(), e ); } finally { IOUtil.close( writer ); } } /** * @return the localRepositoryPath */ public File getLocalRepositoryPath() { return this.localRepositoryPath; } /** * @param theLocalRepositoryPath the localRepositoryPath to set */ public void setLocalRepositoryPath( File theLocalRepositoryPath ) { this.localRepositoryPath = theLocalRepositoryPath; } } maven-install-plugin-2.4/src/main/java/org/apache/maven/plugin/install/InstallMojo.java0000664000175000017500000001313111776337251030606 0ustar ebourgebourgpackage org.apache.maven.plugin.install; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.installer.ArtifactInstallationException; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.artifact.ProjectArtifactMetadata; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; /** * Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, to the local repository. * * @author Emmanuel Venisse * @version $Id: InstallMojo.java 1358784 2012-07-08 17:08:57Z olamy $ */ @Mojo( name = "install", defaultPhase = LifecyclePhase.INSTALL, threadSafe = true ) public class InstallMojo extends AbstractInstallMojo { /** */ @Parameter( defaultValue = "${project.packaging}", required = true, readonly = true ) protected String packaging; /** */ @Parameter( defaultValue = "${project.file}", required = true, readonly = true ) private File pomFile; /** * Set this to true to bypass artifact installation. * Use this for artifacts that does not need to be installed in the local repository. * * @since 2.4 */ @Parameter( property = "maven.install.skip", defaultValue = "false", required = true ) private boolean skip; /** */ @Parameter( defaultValue = "${project.artifact}", required = true, readonly = true ) private Artifact artifact; /** */ @Parameter( defaultValue = "${project.attachedArtifacts}", required = true, readonly = true ) private List attachedArtifacts; public void execute() throws MojoExecutionException { if ( skip ) { getLog().info( "Skipping artifact installation" ); return; } // TODO: push into transformation boolean isPomArtifact = "pom".equals( packaging ); ArtifactMetadata metadata = null; if ( updateReleaseInfo ) { artifact.setRelease( true ); } try { Collection metadataFiles = new LinkedHashSet(); if ( isPomArtifact ) { installer.install( pomFile, artifact, localRepository ); installChecksums( artifact, metadataFiles ); } else { metadata = new ProjectArtifactMetadata( artifact, pomFile ); artifact.addMetadata( metadata ); File file = artifact.getFile(); // Here, we have a temporary solution to MINSTALL-3 (isDirectory() is true if it went through compile // but not package). We are designing in a proper solution for Maven 2.1 if ( file != null && file.isFile() ) { installer.install( file, artifact, localRepository ); installChecksums( artifact, metadataFiles ); } else if ( !attachedArtifacts.isEmpty() ) { getLog().info( "No primary artifact to install, installing attached artifacts instead." ); Artifact pomArtifact = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion() ); pomArtifact.setFile( pomFile ); if ( updateReleaseInfo ) { pomArtifact.setRelease( true ); } installer.install( pomFile, pomArtifact, localRepository ); installChecksums( pomArtifact, metadataFiles ); } else { throw new MojoExecutionException( "The packaging for this project did not assign a file to the build artifact" ); } } for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); ) { Artifact attached = (Artifact) i.next(); installer.install( attached.getFile(), attached, localRepository ); installChecksums( attached, metadataFiles ); } installChecksums( metadataFiles ); } catch ( ArtifactInstallationException e ) { throw new MojoExecutionException( e.getMessage(), e ); } } public void setSkip( boolean skip ) { this.skip = skip; } } maven-install-plugin-2.4/pom.xml0000664000175000017500000001435512021207121016270 0ustar ebourgebourg 4.0.0 maven-plugins org.apache.maven.plugins 23 ../maven-plugins/pom.xml maven-install-plugin 2.4 maven-plugin Maven Install Plugin Copies the project artifacts to the user's local repository. 2004 ${mavenVersion} scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-install-plugin-2.4 scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-install-plugin-2.4 http://svn.apache.org/viewvc/maven/plugins/tags/maven-install-plugin-2.4 jira http://jira.codehaus.org/browse/MINSTALL 2.0.6 3.1 org.apache.maven maven-plugin-api ${mavenVersion} org.apache.maven maven-project ${mavenVersion} org.apache.maven maven-model ${mavenVersion} org.apache.maven maven-artifact-manager ${mavenVersion} org.apache.maven maven-artifact ${mavenVersion} org.apache.maven.plugin-tools maven-plugin-annotations ${mavenPluginPluginVersion} provided org.apache.maven.plugin-testing maven-plugin-testing-harness 1.2 test org.codehaus.plexus plexus-utils 3.0.5 org.codehaus.plexus plexus-digest 1.0 Ludwig Magnusson org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} true mojo-descriptor process-classes descriptor help-goal helpmojo org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} run-its org.apache.maven.plugins maven-invoker-plugin 1.7 true src/it ${project.build.directory}/it */pom.xml */non-default-pom.xml setup verify ${project.build.directory}/local-repo src/it/settings.xml true clean install