Actually, I want to integrate spring javadoc with my netbeans IDE. Spring website only provides an HTML version javadoc online, no download link. But Netbeans only accept a jar/zip file or a local folder.
I know I can build it myself from spring source, but would rather not go through the work.
You can download from this location http://repo.spring.io/libs-release/org/springframework/spring/
You need the -with-docs.zip download
http://www.springsource.com/download/community
It seems the downloads are now managed with Maven only, however, if you want a copy of the JavaDocs locally you could use wget on the JavaDoc URL.
e.g. For release 3.0.5.RELEASE this works a treat.
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains docs.spring.io \
--no-parent \
http://docs.spring.io/spring/docs/3.0.5.RELEASE/javadoc-api/
Or you can just grab the version with source code (which is even better in your IDE anyway).
Sign up over at http://www.springsource.com or just grab it from a maven repository like this one:
http://www.jarvana.com/jarvana/browse/org/springframework/spring-jdbc/
Just grab the release you want (like 2.5.6/spring-jdbc-2.5.6-sources.jar), save to disk, and in Netbeans right-click on your library and select "add local sources".
/ Papa Freud
Using of Maven works for me. In the directory with pom.xml type the command:
mvn dependency:sources -DincludeArtifactIds=spring-aop -Dclassifier=javadoc
After that the jar is available in the ~/.m2 directory.
Now Spring uses artifactory.
Go to corresponding folder for further download.
http://repo.spring.io/webapp/browserepo.html?24
Related
I'm currently migrating to Spring boot 3.0.
In the process, I'm looking into using the newly integrated Native support.
When using pack to build and publish my image, I get an error:
Executing native-image -H:+StaticExecutableWithDynamicLibC -jar /workspace
Error: /workspace is a directory. (-jar requires a valid jarfile)
Apparently, the native-image buildpack is trying to use the folder instead of jar.
I'm using this command to try to build the image.
pack -v build ghcr.io/kevinbos-cc/buildpacks-demo:latest \
--builder paketobuildpacks/builder:tiny \
--path . \
--env "BP_JVM_VERSION=17" \
--env "BP_NATIVE_IMAGE=true" \
--cache-image ghcr.io/kevinbos-cc/buildpacks-demo-paketo-cache-image:latest \
--publish
I've tried to change the paketo-buildpacks/java-native-image version and to use paketo-buildpacks/graalvm.
Unfortently these changes had the same result.
When running the ./gradle bootBuildImage the image is created just fine.
But I can't figure out how to reproduce this in the pack command.
Full stack trace can be found here.
If someone could point me in the right direction, that would be great!
I believe you're hitting an issue between Spring/Gradle & Buildpacks that is fairly common.
I think it was in Spring Boot 2.7, a setting was changed that causes Gradle builds, by default, to produce both a boot-ified and regular JAR file. By itself, this isn't a problem, but buildpacks need to handle multiple JAR files differently than a single JAR file, and some things like a native-image build still only work with single JAR files.
I know for sure that your build is producing two JAR files, as I can see in the output you linked. It says this:
Restoring multiple artifacts
so that's a pretty good sign that you're hitting this issue.
The good news is that this is an easy fix. You just need to tell Gradle to only build the boot-ified JAR.
In your build.gradle set this:
jar {
enabled = false
}
or build.gradle.kts:
tasks.getByName<Jar>("jar") {
enabled = false
}
See here or here for Kotlin.
If that doesn't help, you may be hitting a bug. In that case, please open an issue here and post a sample to reproduce.
I have a Spring Boot 2.x project that uses Gradle 7.x.
I'm assembling a distribution of the artifact/service in a zip / tar file using the built-in Spring Boot task(s) provided. There is no meta-data associated with this asset, nor any need to add anything else to it.
I would like to copy (or publish) this zip / tar file into Artifactory (using Gradle), but so far everything I see around that subject includes (1) the file itself (usually a jar), (2) module meta-data and (3) the POM file.
Is there a way to accomplish what I'm looking for?
Not exactly answers your question, but an easier approach would be to upload to Artifactory using the JFrog CLI:
$ curl -fL https://getcli.jfrog.io
$ ./jfrog rt upload \
--url="https://domain.tld" \
--user="some_user" \
--password="the_password" \
file_to_upload.zip path/within/artifactory/to/place/the/file/
For more information see Uploading Files.
How can I add new features to ODL Oxygen SR3 (0.8.3) as a Karaf module?
For example, I downloaded the prebuilt ODL from the official page. Then I'd like to make the Toaster sample as a new module for Oxygen, it was created with command:
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.archetypes -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeCatalog=remote -DarchetypeVersion=1.1.0-SNAPSHOT
After compiling, it would generate built files to a local maven repository (~/.m2/repository/com/example/toaster). I copied the com/example/toaster to the Karaf default repository folder ./karaf-0.8.3/system. Then I'd like to make it available in feature:list so I can install with feature:install toaster. First I need to add it to the repo list:
./karaf-0.8.3/bin/karaf
feature:repo-add mvn:com.example.toaster/features-toaster
Unfortunately it showed an error:
Error executing command: Error resolving artifact com.example.toaster:features-toaster:jar:0.1.0-SNAPSHOT:
[Could not find artifact com.example.toaster:features-toaster:jar:0.1.0-SNAPSHOT in opendaylight-snapshot (https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/)] : mvn:com.example.toaster/features-toaster
The above command is based on this post. What's the correct way to do repo-add?
Please read the https://karaf.apache.org/manual/latest/#_artifacts_repositories_and_urls
Article.
What you need to do is basically add the repo URl that contains your toaster to the package like so:
(Example from the documentation linked above)
<bundle>http://repo1.maven.org/maven2/org/apache/servicemix/nmr/org.apache.servicemix.nmr.api/1.0.0-m2/org.apache.servicemix.nmr.api-1.0.0-m2.jar</bundle>
Repositories can also be defined using properties:
org.ops4j.pax.url.mvn.repositories : Comma separated list of remote
repository URLs that are checked in order of occurence when resolving
maven artifacts
Source: https://karaf.apache.org/manual/latest/#_maven_url_handler
After building change configuration at the end of file karaf/target/assembly/etc/org.ops4j.pax.url.mvn.cfg into
org.ops4j.pax.url.mvn.repositories= \
file:${karaf.home}/${karaf.default.repository}#id=system.repository, \
file:${karaf.data}/kar#id=kar.repository#multi, \
https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot#id=opendaylight-snapshot#snapshots, \
https://nexus.opendaylight.org/content/repositories/public#id=opendaylight-mirror
Then you can add a repository with
feature:repo-add mvn:org.opendaylight.netconf/features-restconf/1.9.0-SNAPSHOT/xml/features
where groudId: org.opendaylight.netconf, artifactId: features-restconf and version: 1.9.0-SNAPSHOT are depending on the feature you want to add. You can search at https://nexus.opendaylight.org/ with Articfact Search for them and find them in the Maven pom.
I have an Eclipse setup with m2eclipse and subversive. I have imported a maven2 project from svn. But I get the error message that a whole bunch of artifacts are missing (for instance: Missing artifact org.springframework:spring-test:jar:3.0.1.RELEASE:test).
If I look in my repository I see the jar files there but they have an extra extension .lastUpdated. Why is maven appending .lastUpdated to the jars? And more importantly: how can I fix this?
There is no mention of the type lastUpdated in my POMs.
These files indicate to Maven that it attempted to obtain the archive by download, but was unsuccessful. In order to save bandwidth it will not attempt this again until a certain time period encoded in the file has elapsed. The command line switch -U force maven to perform the update before the retry period. This may be necessary if you attempted to build while disconnected from the network.
The method of removing the files works with most versions of maven, but since the files are internal mementos to maven, I would not recommend this method. There is no guarantee that this information is not referenced or held elsewhere and such manipulation can damage the system.
As rperez said, I use to delete all those .lastUpdated files. In Linux I have created a little script to keep it simple:
find -name \*.lastUpdated -exec rm -fv {} +
Just create a file with the previous content and put it on your local Maven repository. Usually it will be ~/.m2/repository.
I installed Maven2 and ran mvn compile from the command line. This seems to have resolved the problem
you might have a problem with some of the artifacts to be retrieved from the repository. for example spring framework has its own repository. this xtension is appended when the artifact cannot fully downloaded. add the spring framework repository to your pom or settings.xml, delete the folder that include the broken jars and start again
If you hit this problem and you're using Nexus, it might be the case that you have a routing rule defined, which is incorrect. I hit this myself and the files it was downloading were correctly named, at the proper URL-s it was looking at, but they were all with the .lastUpdated extension and an error message as contents.
Open your terminal, navigate to your Eclipse's project directory and run:
mvn install
If mvn install doesn't update your dependencies, then call it with a switch to force update:
mvn install -U
This is a much safer approach compared to tampering with maven files as you delete ".lastUpdated".
Use this command inside the .m2/repository dir to rename all files:
for file in `find . -iname *.lastUpdated`; do renamed=$(echo $file | rev | cut -c13- | rev); echo renaming: $file to $renamed; mv $file $renamed; done
This is usefull to not download all sources again.
This not work... The .jar is lost. :(
What I do when I encounter this issue:
Make sure you have the version of the latest 'maven-source-plugin' plugin:
https://maven.apache.org/plugins/maven-source-plugin/usage.html
$ mvn source:jar install
Now if the file *.lastUpdate exist in your local ~/.m2/repositories/your-lib/0.0.1/ directory you can just remove it then run the command above again.
This is a side-effect of a failure to successfully extract from the repository. To get the actual content you want into your repository, check for correct paths to the repository/repositories within your pom file, and resolve certificate/security issues, if any. It is almost invariably one or the other of these issues.
There is no need to delete the .lastUpdated entries, and doing so won't solve your problem.
I run my own little Maven repo for some open source. I have no dedicated server so I use a Google code repository, deploy to file system and then commit and push. Works perfect for me.
But some Maven tools are looking for a nexus-maven-repository-index.properties and the index (in GZ). I would like to generate this index to
get rid of the warning that it's not here
Maven doesn't try the repo for artefacts that are not there.
How can I do that? Is there a tool (Java main) that is able to generate an index? Also tips how to use the proper Nexus Jars with a little commandline tool are welcome.
I came across this post while I was searching for a solution to add a local repository to my Maven project using IntelliJ Idea.
Since Sonatype changed their paths and reorganized the downloads since the last post, here is an updated step-by-step tutorial to get your repository indexed for use with IntelliJ Idea:
Download the latest stand-alone indexer from here.
Extract it somewhere and go into this directory
From the console, run this command: export REPODIR=/path/to/your/local/repo/ && java org.sonatype.nexus.index.cli.NexusIndexerCli -r $REPODIR -i $REPODIR/.index -d $REPODIR/.index -n localrepo
In the directory .index within the repository directory, some files will be created including the file "nexus-maven-repository-index.gz" which is the file IntelliJ looks out for.
You can use the Maven Indexer CLI to product the index directly, but why bother hosting your own repo when OSS projects can use a hosted one for free?
http://nexus.sonatype.org/oss-repository-hosting.html
I was looking at maven indexer... but I am not sure what for is the last parameter indexDir in the method:
public RepositoryIndexer createRepositoryIndexer(String repositoryId,
File repositoryBasedir,
File indexDir)
is it like starting point in the repositoryBasedir?