Need to build a JIRAclient using mvn - jira-rest-java-api

I am new to JIRA client usage. I am trying to create a REST client and create an issue in our JIRA. There are lot if example but none of them are working for me.
I am using mvn and eclipse on win7.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jira</groupId>
<artifactId>jira-int</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>jira-int</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
<name>Atlassian Public Repository</name>
<layout>default</layout>
<url>http://maven.atlassian.com/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
For any version eclipse giving error:
Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for com.atlassian.jira:jira-rest-java-client-core:jar:3.0.1: ArtifactResolutionException: Failure to transfer com.atlassian.jira:jira-rest-java-client-core:pom:3.0.1 from http://maven.atlassian.com/public 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 com.atlassian.jira:jira-rest-java-client-core:pom:3.0.1 from/to central (http://maven.atlassian.com/public): EOFException pom.xml /jira-int line 1 Maven Dependency Problem
Can some one provide me pom and sample client code to create an issue in my JIRA.

You need to add the following dependencies:
<!-- Dependencies for Jira module -->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>${jiraClientVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>${jiraClientVersion}</version>
<scope>provided</scope>
</dependency>
where ${jiraClientVersion} is the jira rest java client version.
Also I have added the following repository:
<repository>
<id>atlassian-public</id>
<url>https://m2proxy.atlassian.com/repository/public</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
Then you can use all the libraries the jira rest java client provides.

Related

Discord JDA Bot - Can't use latest version

I was programming a Discord Bot using JDA (I was using the 5.0.0-alpha.22).
Now I wanted to use the latest version due to some incompatibilities. As far as I know you only need to change the version in the .xml file but it says that the dependency could not be found.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.jurassic</groupId>
<artifactId>NekoBot</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.2</version>
</dependency>
</dependencies>
</project>
Do I need to change other things to use a different version?

Unable to deploy web application built with Spring Boot over Jboss 4.2.2

I am using Spring Boot to build my AngularJS web application. Here is the pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>supervision</groupId>
<artifactId>SUPERVISION</artifactId>
<version>0.1.0.RELEASE</version>
<packaging>war</packaging>
<name>SUPERVISION</name>
<description>SUPERVISION FRONT END + SERVLET</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath />
</parent>
<properties>
<start-class>supervision.SupervisionServlet</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Both the servlet and the front end are working fine on Tomcat 8.0 but for some reason I have to deploy the application over Jboss 4.2.2. When I put my war file in the Jboss deploy folder, it returns me this warning and a 404 page not found:
WARN [javax.enterprise.resource.webcontainer.jsf.config] Unable to process deployment descriptor for context '/SUPERVISION-0.1.0.RELEASE'
I have already tried to add server.servlet-path=/* in the application.properties file but it didn't fix my issue.
Any idea on how to fix this ?
Since your not actually running on tomcat don't state that it is provided instead try excluding it.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

Intellij IDEA – Auto reload a web application

I'm developing an AngularJS and Spring boot application using IntelliJ IDEA 15 and tomcat, whenever I make changes to my static content I've always to restart my application to see those changes.
I looked for a similar problem and I have found this :
Enable IntelliJ hotswap of html and javascript files
But I cant find Update resources option anywhere :
Edit :
This is my project structure :
And this is my pom file :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.***.***</groupId>
<artifactId>***_project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>***_PROJECT</name>
<description>***Project</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-facebook</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- spring security dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- end spring security dependency -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>
In Spring Boot application if you include spring-boot-devtools module as one of your dependency, it can give you additional feature like automatically restart the application whenever files change on classpath.
Add the following dependencies
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
if using Gradle
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
}
Since you are using IntelliJ to trigger automatic restart you need to Make Project ( Build -> Make Project ) (Ctrl + F9 on Windows)
For more information visit here
More information regarding where to add the static content -> here
I would suggest you to use Spring BOOT's Developer Tools library (LiveReload feature). This gives you the ability to restart a project automatically whenever something changes on a classpath
Documentation --> http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html

What is a correct way to deploy an osgi-bundle to ServiceMix?

I try to develop a starter application for Apache ServiceMix dealing with web services.
1) I build the app (using 'mnv install' command)
2) Deploy it to ServiceMix (using 'karaf#root> osgi:install mvn:com.company/ws-test-fuse/1.0.0-SNAPSHOT' command at server console)
3) watch how it got installed ('osgi:list')
[ 157] [Installed ] [ ] [ ] [ 60] A Camel Spring Route (1.0.0.SNAPSHOT)
4) I try to start the app
karaf#root>osgi:start 157
I get this:
org.osgi.framework.BundleException: Unresolved constraint in bundle com.company.ws-test-fuse [157]: Unable to resolve 157.0: missing requirement [157.0] package; (&(package=commonj.sdo)(version>=2.1.0)(!(version>=3.0.0)))
What is a correct way to install a bundle so all the maven dependencies get downloaded and installed automatically?
Also, I am right that all the dependencies will be deployed to the osgi-container as osgi-bundles too?
My POM.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>ws-test-fuse</artifactId>
<packaging>bundle</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>A Camel Spring Route</name>
<url>http://www.myorganization.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<repositories>
<repository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshot.fusesource.org</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>ea.fusesource.org</id>
<name>FuseSource Early Access Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>snapshot.fusesource.org</id>
<name>FuseSource Snapshot Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>ea.fusesource.org</id>
<name>FuseSource Early Access Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- Core -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.9.0.fuse-7-061</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.9.0.fuse-7-061</version>
</dependency>
<!-- Apache Cxf -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.9.0.fuse-7-061</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>2.9.0.fuse-7-061</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>2.5.0.fuse-7-061</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-sdo</artifactId>
<version>2.5.0.fuse-7-061</version>
</dependency>
<!-- Apache tuscany SDO -->
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-api-r2.1</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-lib</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-tools</artifactId>
<version>1.1.1</version>
</dependency>
<!-- SDO Support -->
<dependency>
<groupId>org.eclipse.xsd</groupId>
<artifactId>xsd</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.xsd</groupId>
<artifactId>xsd</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore-change</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore-xmi</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>common</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>codegen-ecore</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>codegen</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>3.0</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>2.9.0.fuse-7-061</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- allows the route to be ran via 'mvn camel:run' -->
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>2.9.0.fuse-7-061</version>
</plugin>
<!-- Maven bundle plugin -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*,org.apache.camel.osgi</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
An alternative is to use FAB to deploy to ServiceMix (you would need to install FAB) / Fuse ESB (comes with FAB).
FAB is capable of understanding your maven pom.xml file and deploy needed bundles at deployment time. I posted some links for more details and videos at:
http://www.davsclaus.com/2012/08/osgi-deployment-made-easy-with-fab.html
Another alternative is to create a features.xml file, and install your application using a feature. Then in the features file you can specify the osgi bundles your application requires as well. And you can refer to other features etc. For example this is how you can install Camel components, using a single command. For example to install the Camel FTP component you can run:
features:install camel-ftp
So if you have a feature for your application you could do similar.
Karaf does not parse your pom.xml, to resolve dependencies you must install them manually with features:install or bundle:install. F.ex. in your case
bundle:install mvn:org.eclipse.persistence/com.springsource.commonj.sdo/2.1.1

Faild to read artifact descriptor error while adding resteasy-jaxb-provider

I am learing REST throught java using JBoss RestEasy. To use JAXB api implementation I given the following dependency in pom.xml, {I am using maven project in eclipse}
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.1.GA</version>
</dependency>
But I am getting some set of build errors. But the below is the root cause of the errors I guess,
ArtifactDescriptorException: Failed to read artifact descriptor for javax.xml.stream:stax-api:jar:1.0-2:
ArtifactResolutionException: Failure to transfer javax.xml.stream:stax-api:pom:1.0-2 from
http://repo1.maven.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 javax.xml.stream:stax-api:pom:1.0-2 from/to central (http://repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.pom
By the above error I understand that it failed to transfer the stax-api depency file. I added the dependency for that stax-api later. But no use. Still getting the same error.
Is my perception of the above error correct? If so do I have to give the repository info for this file too in pom.xml? Then is it not contradicting the main advantage of Maven usage(auto download of dependency files)?
Please correct me if I were wrong
Below is my complete pom.xml,
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.droidaceapps.services</groupId>
<artifactId>RestServicesProject</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>RestServicesProject Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>jboss</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.1.GA</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>2.3.1.GA</version>
</dependency>
</dependencies>
<build>
<finalName>RestServicesProject</finalName>
</build>
</project>
Thanks
Hurrah...I solved this. I did execute the MVN from command line .. it just worked. Then I went back to eclipse and refreshed the project then all the bugs gone and all dependancies are in place.
seems there is a problem with the m2eclipse plugin (whichi I conculde as root cause of the bug.. :-)
i solved this problem....not using maven.......just by creating a Dynamic web project...with jboss server..with web.xml
and then...go to source > new >other >web service > create a sample restful web serivce
click to update the web.xml......and it support jboss in eclipse

Resources