Is there a trimmed version of AWS Jar file for S3 - aws-java-sdk

I downloaded AWS SDK for Java. The JAR file is around 80MB. Is there a smaller version for just S3. I do not need other stacks and am wonder if I can trim this JAR file down a bit.

Yes, check the SDK setup instructions. There are artifacts published for every module. So if you only need S3, you can add just it to your Maven project:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.297</version>
</dependency>
Or if you're using another build tool, see the linked instructions. You can also find the published artifact on Maven Central: com.amazonaws : aws-java-sdk-s3 : 1.11.297.

Related

PDFBox 2.0.4 has different JAR files when downloaded from its site and when taken from Maven

If I use
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.4</version>
</dependency>
as instructed at https://pdfbox.apache.org/2.0/getting-started.html I don't get the classes at org.apache.pdfbox.tools and org.apache.pdfbox.tools.imageio (such as ImageIOUtil, JPEGUtil, MetaUtil, TIFFUtil and others).
However, if I download JAR file from http://www.gtlib.gatech.edu/pub/apache/pdfbox/2.0.4/pdfbox-app-2.0.4.jar as directed from https://pdfbox.apache.org/download.cgi#20x, I get them all.
What you got from maven is the pdfbox download. What you got from the download URL (where you might notice 10 different downloads) is pdfbox-app, which is for the command line tools (and contains everything). These are different downloads. If you want ImageIOUtil, JPEGUtil, MetaUtil, TIFFUtil, then get pdfbox-tools as an addition to the pdfbox artifact.

how to manage dependency of shared libraries using IVY

I have a EAR -
This EAR contains multiple WAR
Inside these WAR files there is a common JAR which is getting downloaded within each WAR file.
I want to remove this common JAR file into a shared Library. Also i want the latest version of JAR file everytime i rebuild my WAR, I am using Tomcat in Dev and Websphere min production.
We are using IVY for dependency management, Now. I have removed the common jar from the war file, but i dont know how to access the latest version of jar and download it in the shared library everytime i restart my server.
Can anyone help on this.?
http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
You'll need to add a dependency to your ivy.xml file, something along the lines of:
<dependency org="com.orgname" name="jarname" rev="latest.release"/>
Is this a JAR file you make yourself, or is it publicly available? If you make it yourself, you will have to publish it in a repository somewhere in your system.

Plugin does not exist or no valid version can be found error

I have downloaded the complete source of hudson jira API plugins and am trying to build it by mvn install. The jira plugin gets build properly, but when it tries to build the hudson plugin, I am getting the error
[INFO] The plugin 'org.kohsuke:access-modifier-checker' does not exist or no valid version could be found. The access-modifier-checker jar file (1.0) is present in my local repository.
Tried this from multiple machines and I am getting the same error. Also I tried to google the issue, but to no avail. Is there anything I am missing?
edit: I have also tried deleting the contents of .m2/repository folder
edit2: pom.xml snippet
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>access-modifier-checker</artifactId>
<version>1.0</version>
</dependency>
The JIRA plugin jar file needs to be installed in {jira.home}/plugins/installed-plugins for version 2 plugins, or atlassian-jira/WEB-INF/lib for version 1 plugins.

Download Maven2 dependency from non-standard layout repository

I need to download a file from a non-standard layout repository.
The standard repository layout is groupId>/<artifactId>/<version>/<artifactId>-<version>.<packaging> however, I need to download the following file:
http://hudson.myserver.com:10000/repo/ocp-services/schemas/trunk/201/archive/schemas/dist/schemas.jar
where ocp-services is effectively the groupId, schemas is the artifactId and 201 is the version.
How would I add a dependency to this file and get it downloaded into my project and local repository?
This is a Hudson file repository if this is of any help, but it is a third parties so difficult to get them to change any location.
One option would be to register a custom ArtifactRepositoryLayout implementation and to declare a repository using this custom layout. I've never done that but it should be possible, check this blog post.
A second option would be to configure Maven to go through some kind of custom proxy (e.g. a Servlet) and to rewrite the URL on the fly for this particular dependency.
In both cases, I'm afraid Maven will complain about missing metadata ("A dependency in Maven isn't just a JAR file", see 3.5.5. Maven's Dependency Management) because the hudson file repository is just not a Maven repository. Maybe this can be handled programmatically though. But as I said, I've never done this.
A third option would be to ask the project building the JAR you need to deploy it (in the maven sense). That would be of course the best solution.
A last one option would be to just download this JAR and to install it manually in your local repository. If this is an option, go for it.
Have you tried adding this to your pom.xml :
<dependencies>
<dependency>
<groupId>ocp-services</groupId>
<artifactId>schemas</artifactId>
<version>201</version>
<type>jar</type>
</dependency>
</dependencies>
or if that don't work as Pascal says install it manually

Maven, how to add additional libs not available in repo

I have a maven project that has a set of library dependancies that are not available via any maven repository. How can I add those libraries to the pom? I want to do this so when I run 'mvn eclipse:eclipse' it doesnt remove those libraries from the eclipse classpath.
You can declare it as a dependency with system scope.
<project>
...
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
...
</project>
You have 3 options:
Add your libraries to your local repository via install:install-file (obviously, this is not portable, you won't be able to build the project on another machine without doing the same).
Install and run an "enterprise repository" like Nexus, Archiva, or Artifactory and add your libraries via deploy:deploy-file.
Setup a file based repository as described in this previous answer and put your libraries in there.
Then, declare your libraries in your pom like any other dependency.
You can include them with your project in a sub-directory (perhaps lib/). You can also provide .bat and/or .sh files containing all the appropriate calls to the maven-install-plugin necessary for each project member (or server env) to add these jars to the local repo.
This approach allows new project members to get up & running quickly, without having to invest several hours in setting up a new public repo for your project or team.
You can't 'add them to the pom'. You have to put them in some repo. You can put them in the local repo with the maven-install-plugin, as suggested by the error message. Or you can deploy them in a local copy of Nexus or something like it.
recently I created a small UI Util to install libraries to you local repository.
It works the same way as install:install-file.
https://github.com/escv/maven-install-ui