Maven @ jar installation & confliction

4 篇文章 0 订阅
  • Cannot load resource with pom.xml:

If define dependency on pom.xml with Oracle jdbcdriver, got failed with error : "Missing artifact com.oracle:ojdbc14:jar: 10.2.0.3.0:provided" , that is due to copyright issue, such jar does not exist in central repository。

<dependency>
	<groupId>com.oracle</groupId>
	<artifactId>ojdbc14</artifactId>
	<version>10.2.0.3.0</version>
	<scope>provided</scope>
</dependency>

Solution:

mvn install:install-file -DgroupId=com.oracle-DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar-Dfile=D:/Docs/ojdbc14.jar

Here there is no white space before some "-D" parameters, we use -X to open debug, it will showBuild Failure with wrong groupid and missed artifactId:


Then correct it by adding white space before each "-D" parameter and execute it again:


Explanation:

This solution will load and put this jar to local repository. (I have repository management with Archiva)


  • Activation.jar confliction:

we know activation.jar exists in many servers, so in our project it should not be included to WEB-INF/lib directory, but our some jar will dependent on such jar, then we can exclude activation.jar from our project by :

<dependency>
	<groupId>org.jboss.resteasy</groupId>
	<artifactId>resteasy-jaxrs</artifactId>
	<version>${org.jboss.resteasy}</version>
	<exclusions>
		<exclusion>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
		</exclusion>
	</exclusions>
</dependency>


  • Put a war to running server say Tomcat:
<build>
    <finalName>Spring_TX_Thread</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <outputDirectory>D:\Software\Tomcat\webapps\</outputDirectory>
            </configuration>
        </plugin>       
    </plugins>
  </build>

  • Cannot check out a project from SCM with Eclipse Import...
When I want to import a project with an URL, at "Checkout as Maven project from SCM" window, there is no option for SCM URL type dropdown, that is because I did not install "Maven SCM handler for Subclipse", so I went to "Help->Install New Software...", then a Install window prompts, wirte "m2e-extras - http://m2eclipse.sonatype.org/sites/m2e-extras" in blank input box tailed with "Work with:", wait a minute, there would be show a list of plugins you can select to install. Among of them there is one named "Maven Integration for Subclipse", expend it, then a child is "Maven SCM handler for Subclipse", select it and next and finish,
But I would encounter error like :
Cannot complete the install because one or more required items could not be found.
Software being installed: Maven SCM handler for Subclipse (Optional) 0.9.8.200905041414 (org.maven.ide.eclipse.subclipse.feature.feature.group 0.9.8.200905041414)
Missing requirement: Maven SCM handler for Subclipse (Optional) 0.9.8.200905041414 (org.maven.ide.eclipse.subclipse.feature.feature.group 0.9.8.200905041414) requires 'org.tigris.subversion.subclipse.ui 0.0.0' but it could not be found

Then it is very clear that I failed to install Subclipse pulgin first in Eclipse, so do the same as we install "Maven SCM handler for Subclipse", except that input "subclipse - http://subclipse.tigris.org/update_1.6.x" in the blank followed with "Work with:".
Once I installed Subclipse successfully, I went back to install SCM handler, make it hit too.
Then I tried to import functionality to import a project from SVN repository....
However, still got a strange error:
checkout https://src.springframework.org/svn/spring-security/tags/spring-security-3.0.0.RELEASE -r HEAD --depth=infinity --force
    RA layer request failed
svn: OPTIONS of 'https://src.springframework.org/svn/spring-security/tags/spring-security-3.0.0.RELEASE': Could not resolve hostname `src.springframework.org': The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.
 (https://src.springframework.org)

via google, I found one link :  Accessing remote SVN Repositories from Eclipse  
That means go to "Window->Preference->Team->SVN", select "SVNKit(PureJava)" instead of "JavaHL JNI" for "SVN Interface", exact reason it gives a link.
After so much things done, I could download projects from SVN smoothly.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值