Finally I go to the workspace project folder and use the command
mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
then the sources is downloded.
the screen message is attached.
________________________________
寄件人︰ tong123123 <[email protected]>
收件人︰ Maven Integration for Eclipse users mailing list <[email protected]>
傳送日期︰ 2012年10月15日 (週一) 10:17 AM
主題︰ [m2e-users] 回覆︰ 回覆︰ 回覆︰ how to including -sources.jar in pom
really don't know what matter, I can use open declaration to see the source of
getJdbcTemplate() in my home pc, but cannot in my notebook.
I already try Force Update of Snapshots/Releases, and no any error prompt, but
the spring source still cannot be shown.
Attached is the screen shown.
________________________________
寄件人︰ Anders Hammar <[email protected]>
收件人︰ Maven Integration for Eclipse users mailing list <[email protected]>;
tong123123 <[email protected]>
傳送日期︰ 2012年10月13日 (週六) 2:06 PM
主題︰ Re: [m2e-users] 回覆︰ 回覆︰ how to including -sources.jar in pom
Reading what you responded on I get what you mean.
Do this:
* Select the project
* Right click and select Maven->Update Project... (m2e v1.2, I think
it was called Update dependencies in m2e v1.1)
* In the Update Maven Project pop-up, be sure to check "Force Update
of Snapshots/Releases". Click
ok.
But depending on the infrastructure this might not be enough. If
you're using a repo manager, it will probably also cache "not found"
info so it has to be cleared (talk to the admins) or you just have to
wait for it to expire (default is 24h if you're using Nexus).
/Anders
On Sat, Oct 13, 2012 at 7:54 AM, Anders Hammar <[email protected]> wrote:
> What do you mean by "update"? Update what?
>
> /Anders (mobile)
>
> Den 13 okt 2012 07.36 skrev "tong123123" <[email protected]>:
>
>> how to "force an update" in eclipse?
>> thanks in advance
>>
>> ________________________________
>> 寄件人︰ Matthew Piggott <[email protected]>
>> 收件人︰ Maven Integration for Eclipse users mailing list
>> <[email protected]>
>> 傳送日期︰ 2012年10月12日 (週五) 9:57 PM
>> 主題︰ Re: [m2e-users] 回覆︰ how to including -sources.jar in pom
>>
>> You probably need to force an update after receiving the error in the
>> first post. It looks as if it were caused by a connection error of some
>> type, perhaps a proxy?
>>
>> On 12 October 2012 05:36, tong123123 <[email protected]> wrote:
>>
>> when press F3, the Source not found error page is shown.
>> "the JAR file
>>
c:\users\teamC\.m2\repository\org\springframework\spring\2.5.6\spring-2.5.6.jar
>> has no source attachment."
>>
>>
>> ________________________________
>> 寄件人︰ Anders Hammar <[email protected]>
>> 收件人︰ tong123123 <[email protected]>; Maven Integration for Eclipse
>> users mailing list <[email protected]>
>> 傳送日期︰ 2012年10月12日 (週五) 4:52 PM
>> 主題︰ Re: [m2e-users] how to including -sources.jar in pom
>>
>> You shouldn't have to change your pom.
>> I checked and the sources jar seems to exist in central, but in my
>> experience just
hoovering on the method doesn't download it. Try
>> opening the method by putting the cursor there and hitting F3. It
>> should take you to the source, which will be downloaded automatically.
>> It might take a few seconds though, so be patient.
>> There are other ways to accomplish the source to be downloaded, but
>> this is the easiest way I think. You could configure m2e to always try
>> to download sources, but I wouldn't recommend that as it will IMO have
>> some severe performance drawbacks.
>>
>> /Anders
>>
>> On Fri, Oct 12, 2012 at 10:35 AM, tong123123 <[email protected]>
>> wrote:
>> > When my mouse hover getSimpleJdbcTemplate(), I want it will display the
>> > relevant api, but it cannot and show the message in
springSource.jpg
>> > "
>> > Note: The Javadoc for this element could neither be found in the
>> > attached
>> > source nor the attached Javadoc."
>> >
>> > I think the problem come from the pom.xml, I want to download
>> > spring-2.5.6-sources.jar
>> > but it download spring-2.5.6.jar only,
>> > the pom.xml is
>> > <dependency>
>> > <groupId>org.springframework</groupId>
>> > <artifactId>spring</artifactId>
>> > <version>2.5.6</version>
>> > </dependency>
>> >
>> > I try to add
>> > <classifier>sources</classifier>
>> > but the following error shown:
>> >
"ArtifactTransferException: Failure to transfer
>> > org.springframework:spring:jar:sources:2.5.6 from
>> > http://repo.maven.apache.org/maven2 was cached in the local repository,
>> > resolution will not be reattempted until the update interval of central
>> > has
>> > elapsed or updates are forced. Original error: Could not transfer
>> > artifact
>> > org.springframework:spring:jar:sources:2.5.6 from/to central
>> > (http://repo.maven.apache.org/maven2): Remotely Closed [id: 0x010edf78,
>> > /172.20.10.2:55369 :> repo.maven.apache.org/68.232.45.223:80]"
>> >
>> > how to make the api shown when my mouse hover spring function?
>> >
>> >
_______________________________________________
>> > m2e-users mailing list
>> > [email protected]
>> > https://dev.eclipse.org/mailman/listinfo/m2e-users
>> >
>>
>>
>>
>> _______________________________________________
>> m2e-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>
>>
>>
>> _______________________________________________
>> m2e-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>
>>
>>
>> _______________________________________________
>> m2e-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>
>
_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users
C:\Workspace\SpringJDBCExample>mvn eclipse:eclipse -DdownloadSources=true
-DdownloadJavadocs=true
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.mkyong.common:SpringExample:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 37, column 19
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten
the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.9/maven-eclipse-plugin-2.9.jar
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-eclipse-plugin/2.9/maven-eclipse-plugin-2.9.jar
(213 KB at 108.7 KB/sec
)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringExample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-eclipse-plugin:2.9:eclipse (default-cli) @ SpringExample >>>
[INFO]
[INFO] <<< maven-eclipse-plugin:2.9:eclipse (default-cli) @ SpringExample <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.9:eclipse (default-cli) @ SpringExample ---
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/2.1/wagon-provider-api-2.1.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/2.1/wagon-provider-api-2.1.pom
(2 KB at 4.4 KB/sec)
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/2.1/wagon-2.1.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/2.1/wagon-2.1.pom
(16 KB at 41.8 KB/sec)
Downloading:
http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
Downloading:
http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar
Downloading:
http://repo.maven.apache.org/maven2/jline/jline/0.9.1/jline-0.9.1.jar
Downloading:
http://repo.maven.apache.org/maven2/org/eclipse/core/resources/3.3.0-v20070604/resources-3.3.0-v20070604.jar
Downloaded:
http://repo.maven.apache.org/maven2/jline/jline/0.9.1/jline-0.9.1.jar (46 KB at
44.0 KB/sec)
Downloaded:
http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
(139 KB at 51.7 KB/sec
)
Downloaded:
http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar
(245 KB at 88.6 KB/sec)
Downloaded:
http://repo.maven.apache.org/maven2/org/eclipse/core/resources/3.3.0-v20070604/resources-3.3.0-v20070604.jar
(663 KB at 153.9 KB/sec)
[INFO] Using Eclipse Workspace: C:\Workspace
[WARNING] Workspace defines a VM that does not contain a valid jre/lib/rt.jar:
C:\liferay-portal-6.0.6\tomcat-6.0.29\jre1.6.0_20\win
[INFO] no substring wtp server match.
[INFO] Using as WTP server : Apache Tomcat v6.0
[INFO] Adding default classpath container:
org.eclipse.jdt.launching.JRE_CONTAINER
Downloading:
http://repo.maven.apache.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6-sources.jar
Downloaded:
http://repo.maven.apache.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6-sources.jar
(3096 KB at 232.0 KB/sec)
Downloading:
http://repo.maven.apache.org/maven2/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9-sources.jar
Downloading:
http://repo.maven.apache.org/maven2/junit/junit/3.8.1/junit-3.8.1-javadoc.jar
Downloading:
http://repo.maven.apache.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6-javadoc.jar
Downloading:
http://repo.maven.apache.org/maven2/mysql/mysql-connector-java/5.1.9/mysql-connector-java-5.1.9-javadoc.jar
[INFO] Not writing settings - defaults suffice
[INFO] File C:\Workspace\SpringJDBCExample\.project already exists.
Additional settings will be preserved, run mvn eclipse:clean if you want
old settings to be removed.
[INFO] Wrote Eclipse project for "SpringExample" to
C:\Workspace\SpringJDBCExample.
[INFO]
Sources for some artifacts are not available.
List of artifacts without a source archive:
o mysql:mysql-connector-java:5.1.9
Javadoc for some artifacts is not available.
List of artifacts without a javadoc archive:
o junit:junit:3.8.1
o org.springframework:spring:2.5.6
o mysql:mysql-connector-java:5.1.9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.434s
[INFO] Finished at: Mon Oct 15 11:48:59 CST 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
C:\Workspace\SpringJDBCExample>_______________________________________________
m2e-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/m2e-users