Recently I wrote the maven2 plug-in for project statistics and encountered an exception when publishing it to the maven2 library of java.net:
- Daniel @ Daniel-LAPTOP :~ /Work/sources/Java/Maven-statistic-plugin $ MVN deploy
- [Info] scanning for projects...
- -----------------------------------------------------
- This realm = plexus. Core. Child-container [extensions]
- URLs [0] = file:/home/Daniel/. m2/Repository/org/codehaus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar
- URLs [1] = file:/home/Daniel/. m2/Repository/org/jvnet/wagon-SVN/1.9-Snapshot/wagon-svn-1.9-SNAPSHOT.jar
- URLs [2] = file:/home/Daniel/. m2/Repository/org/jvnet/Hudson/svnkit/1.1.4-Hudson-4/svnkit-1.1.4-hudson-4.jar
- URLs [3] = file:/home/Daniel/. m2/Repository/CH/ethz/ganymed/ganymed-ssh2/build210/ganymed-ssh2-build210.jar
- Number of imports: 0
- This realm = plexus. Core
- URLs [0] = file:/usr/share/maven2/lib/wagon-ssh-common.jar
- URLs [1] = file:/usr/share/maven2/lib/commons-cli.jar
- URLs [2] = file:/usr/share/maven2/lib/plexus-container-default.jar
- URLs [3] = file:/usr/share/maven2/lib/plexus-interactivity-api.jar
- URLs [4] = file:/usr/share/maven2/lib/wagon-ssh.jar
- URLs [5] = file:/usr/share/maven2/lib/maven2.jar
- URLs [6] = file:/usr/share/maven2/lib/jtidy. Jar
- URLs [7] = file:/usr/share/maven2/lib/plexus-utils.jar
- URLs [8] = file:/usr/share/maven2/lib/doxia-sink-api.jar
- URLs [9] = file:/usr/share/maven2/lib/wagon-http-shared.jar
- URLs [10] = file:/usr/share/maven2/lib/jsch. Jar
- URLs [11] = file:/usr/share/maven2/lib/wagon-file.jar
- URLs [12] = file:/usr/share/maven2/lib/wagon-http-lightweight.jar
- URLs [13] = file:/usr/share/maven2/lib/xml-apis.jar
- URLs [14] = file:/usr/share/maven2/lib/wagon-ssh-external.jar
- URLs [15] = file:/usr/share/maven2/lib/wagon-provider-api.jar
- Number of imports: 0
- -----------------------------------------------------
- [Info] ------------------------------------------------------------------------
- [Info] building statistic
- [Info] task-segment: [deploy]
- [Info] ------------------------------------------------------------------------
- [Info] [Plugin: descriptor]
- [Info] using 2 extractors.
- [Info] applying Extractor for language: Java
- [Info] Extractor for language: Java found 4 mojo descriptors.
- [Info] applying Extractor for language: bsh
- [Info] Extractor for language: bsh found 0 mojo descriptors.
- [Info] [resources: Resources]
- [Info] Using default encoding to copy filtered resources.
- [Info] [compiler: Compile]
- [Info] Nothing to compile-All classes are up to date
- [Info] [resources: testresources]
- [Info] Using default encoding to copy filtered resources.
- [Info] [Compiler: testcompile]
- [Info] Nothing to compile-All classes are up to date
- [Info] [surefire: Test]
- [Info] surefire report Directory:/home/Daniel/work/sources/Java/Maven-statistic-plugin/target/surefire-Reports
- -------------------------------------------------------
- T e S t s
- -------------------------------------------------------
- Running net. java. Dev. Statistic. csssourcestatisticmojotest
- Execute
- -----------------
- CSS source file count: 1
- White lines: 7
- Comment lines: 20
- Normal lines: 65
- Total: 92
- -----------------
- Tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 0.119 Sec
- Running net. java. Dev. Statistic. javasourcestatisticmojotest
- Execute
- -----------------
- Java source file count: 2
- White lines: 3
- Comment lines: 42
- Normal lines: 9
- Total: 54
- -----------------
- Tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 0.038 Sec
- Running net. java. Dev. Statistic. xhtmlsourcestatisticmojotest
- Execute
- -----------------
- XHTML source file count: 2
- White lines: 9
- Comment lines: 0
- Normal lines: 63
- Total: 72
- -----------------
- Tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 0.037 Sec
- Running net. java. Dev. Statistic. packagestatisticmojotest
- Execute
- -----------------
- Java non empty package count: 2
- Java empty package count: 3
- Java empty package path:
- Src/test/Java/NET/Java/dev/Statistic/project/main/Java/package3/emptypackage1
- Src/test/Java/NET/Java/dev/Statistic/project/main/Java/package2/emptypackage2
- Src/test/Java/NET/Java/dev/Statistic/project/main/Java/package1/package1_1/emptypackage3
- All Java package count: 5
- -----------------
- Tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 0.024 Sec
- Results:
- Tests run: 4, failures: 0, errors: 0, skipped: 0
- [Info] [jar: jar]
- [Info] building jar:/home/Daniel/work/sources/Java/Maven-statistic-plugin/target/maven-statistic-plugin-0.0.1.jar
- [Info] [Plugin: addpluginartifactmetadata]
- [Info] [install: Install]
- [Info] installing/home/Daniel/work/sources/Java/Maven-statistic-plugin/target/maven-statistic-plugin-0.0.1.jar to/home/Daniel /. m2/Repository/NET/Java/dev/Maven-statistic-plugin/0.0.1/maven-statistic-plugin-0.0.1.jar
- [Info] [Plugin: updateregistry]
- [Info] [deploy: deploy]
- Altdeploymentrepository = NULL
- [Info] ------------------------------------------------------------------------
- [Error] Build Error
- [Info] ------------------------------------------------------------------------
- [Info] Error deploying artifact: Unsupported Protocol: 'java-net': cannot find wagon which supports the requested protocol: Java-Net
- Component descriptor cannot be found in the component Repository: org. Apache. Maven. Wagon. wagonjava-net.
- [Info] ------------------------------------------------------------------------
- [Info] For more information, run Maven with the-e Switch
- [Info] ------------------------------------------------------------------------
- [Info] total time: 8 seconds
- [Info] finished at: Fri Dec 12 21:26:17 CST 2008
- [Info] final memory: 13 m/24 m
- [Info] ------------------------------------------------------------------------
The reason is that libwagon-Java is packaged in Ubuntu (Debian system). Please download the official Maven from Apache and specify the path of Apache Maven when running MVN.