2011-11-09 22 views
3

私は内部リポジトリを作成しました。私はmavenを使って作成されていないjarファイルを持っています。つまり、pom.xmlファイルはありません。私は作成した内部リポジトリにこのjarをデプロイする必要があります。この目的のために、私はmvn deploy:deploy-fileを使用しました。 後は、私が使用しているコマンドです -javenを内部リポジトリにデプロイ

MVN -X展開:展開ファイル-Durl = SCP:// localhost /を私-レポ/ -DrepositoryId = localhostの-Dfile = temp.jar -DgroupId = comの.myorg -DartifactId =一時-Dversion = 1.0 -Dpackaging =瓶-Dclassifier =テスト-DgeneratePom =真-DgeneratePom.description = "一時テスト" -DrepositoryLayout =デフォルト-DuniqueVersion = falseを

私は、Windows XPを使用していますし、 apache-maven-3.0.3。次のエラーが発生する -

"[エラー]目標org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file(default-cli)をプロジェクトで実行できませんでしたstandalone-pom:Failedアクセスリポジトリはlocalhost(SCP:// localhost /をコモンズ-ログ/)で利用可能なコネクタなし:アーティファクト/メタデータのデプロイするために、私が働いているとして使用可能なファクトリWagonRepositoryConnectorFactory」

を使用してタイプのデフォルトのを私はWindows上でscpコマンドを使用したことがありませんLinuxマシンでは、私はこの仕事を達成するためにインストールする必要はありません。どこからインストールすればいいのですか、私が直面しているエラーをどのように克服するのでしょうか。この問題に関して私を案内してください。

ありがとうございます!

+0

エラーが解決されただけで、jarをmaven_install_dir/lib/ext /にコピーする必要があります。以下はjarファイルです 1. jsch-0.1.38.jar 2. plexus-interactivity-api-1.0-alpha-6 3. wagon-ssh-1.0-beta-7 4. wagon-ssh-common -1.0-beta-7 これは、mavenを使用して作成されていないjarをデプロイしようとしているため、pom.xmlを持たないため、追加できません。 ...を実行する必要があります。したがって、それらをmvn/lib/ext /に直接追加しています。 –

答えて

1

このリポジトリの内容については言及していません。問題のリポジトリがローカルマシンのリポジトリがある場合は、この操作を行うことができます。リポジトリはネクサスのようなものである

mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dpackaging=jar -Dversion=1.0.1B -Dfile=jta-1.0.1B.jar -DgeneratePom=true 

場合は、アーティファクトをアップロードするために彼らのUIを使用して、それはあなたのためにポンポンを作成します。

0

sshを使用して独自のサードパーティ製のjarファイルを社内のリポジトリに展開するのと同じ問題がありました。小さなAntスクリプトを使用して終了しましたが、Mavenのクラスパスを使用するよりも安全だと感じました。

<?xml version="1.0"?> 
<project name="Maven Deploy" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> 

    <property name="repository.id" value="myrepository"/> 
    <property name="repository.url" value="sftp://dev.example.com/var/www/mvn"/> 

    <target name="init"> 
    <mkdir dir="target/lib"/> 
    <get src="http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar" dest="target/lib" skipexisting="true"/> 
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpath="target/lib/maven-ant-tasks-2.1.3.jar"/> 

    <artifact:install-provider artifactId="wagon-ssh" version="2.2"/> 
    </target> 

    <target name="deploy" depends="init"> 

    <echo>Deploy a jar to the Maven repository:</echo> 
    <input addproperty="groupId" message="groupId:"/> 
    <input addproperty="artifactId" message="artifactId:"/> 
    <input addproperty="version" message="version:"/> 
    <input addproperty="file"  message="file:" defaultvalue="${artifactId}-${version}.jar"/> 

    <artifact:mvn failonerror="true"> 
     <arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file"/> 
     <arg value="-DgroupId=${groupId}"/> 
     <arg value="-DartifactId=${artifactId}"/> 
     <arg value="-Dversion=${version}"/> 
     <arg value="-Durl=${repository.url}"/> 
     <arg value="-DrepositoryId=${repository.id}"/> 
     <arg value="-Dfile=${file}"/> 
    </artifact:mvn> 

    </target> 

</project> 

だけant deployを入力し、ファイルののgroupId、たartifactIdとバージョンを指定します。

1

mvn deploy:deploy-file -Durl=scp://d8u.us/home/hd1/public_html/maven2 -DrepositoryId=localhost -Dfile=yourwar.jar -DgroupId=us.d8u -DartifactId=yourwar -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true -DrepositoryLayout=default -DuniqueVersion=falseが私に役立ちます。私は単に自分のホームディレクトリの下にmaven2ディレクトリを作成し、ウェブユーザーに適切なアクセス許可を設定し、Mr. Sierraさんのブログを寄せ集めて、近辺のinstructions for my caseを親切に提供していました。

関連する問題