I'm trying to run integration tests for a JIRA plugin in jenkins. I get the following warning:
Running xxx
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/prj/xxx/atlassian/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/prj/xxx/atlassian/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Any idea how to disable this?
I have alrady read that: http://www.slf4j.org/codes.html#multiple_bindings
But this didn't help me too much.
What exactly dependency or exclusion (and where in the pom.xml) do I need to set to get rid of this warning.
pom.xml:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx</groupId>
<artifactId>xxx</artifactId>
<version>1.0</version>
<organization>
<name>xxx</name>
<url>xxx</url>
</organization>
<name>ClearQuestIdTrimmer</name>
<description>This plugin trims the ClearQuestIds.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
<!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
<!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-tests</artifactId>
<version>${jira.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-func-tests</artifactId>
<version>${jira.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productDataPath>${project.basedir}/src/test/resources/generated-test-resources.zip</productDataPath>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<testGroups>
<testGroup>
<id>wired-integration</id>
<productIds>
<productId>jira</productId>
</productIds>
<includes>
<include>it/**/*WiredTest.java</include>
</includes>
</testGroup>
<testGroup>
<id>traditional-integration</id>
<productIds>
<productId>jira</productId>
</productIds>
<includes>
<include>it/**/*TrdTest.java</include>
</includes>
</testGroup>
</testGroups>
<!-- Uncomment to install TestKit backdoor in JIRA. -->
<!--
<pluginArtifacts>
<pluginArtifact>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-plugin</artifactId>
<version>${testkit.version}</version>
</pluginArtifact>
</pluginArtifacts>
-->
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jira.version>6.1-20130626</jira.version>
<amps.version>4.2.3</amps.version>
<plugin.testrunner.version>1.1.1</plugin.testrunner.version>
<!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
<testkit.version>6.0.25</testkit.version>
<!-- Set encoding to UTF 8 - needed for Jenkins Integration Test -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- run integration tests in headless mode on CI -->
<xvfb.enable>true</xvfb.enable>
</properties>
Use the Maven Dependency plugin to trace the source of transitive dependencies:
mvn dependency:tree -Dverbose -Dincludes=slf4j-simple
With that output, you should be able to add the needed exclusions in the pom.xml.
I suspect you don't have problem when running your maven build locally? If so, you can probably ignore this issue. If you do have the same problem locally then ignore what follows and use dependency:tree :)
The reason is that Jenkins bundle multiple slf4j bindings to work-around a fatal issue.
The commit log was
Bundle slf4j binding to the war. See the comment in war/pom.xml for
detailed discussion. This is fundamentally a "damned if I do, damned
if I don't" situation, but given that JENKINS-12334 is a fatal error,
and the downside of bundling the binding jar is "multiple binding"
warning, it seems like the lesser evil is to bundle it and risk some
warnings.
Issue | Commit | More information
Related
I have my mail handler plugin which works fine in Jira 7.13.18, but when I try to start Jira 8.13.2 with that, plugin doesn't start. The reason is:
'Extended Mail Handler' failed to load.
Error creating bean with name 'sendMessageService': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.velocity.VelocityManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value="")}
No qualifying bean of type 'com.atlassian.velocity.VelocityManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport(value="")}
Here is code of sendMessageService:
#Named
public class SendMessageService {
private final MailServerManager mailServerManager;
private final MailQueue mailQueue;
private final VelocityManager velocityManager;
#Inject
public SendMessageService(#ComponentImport MailServerManager mailServerManager,
#ComponentImport MailQueue mailQueue,
#ComponentImport VelocityManager velocityManager) {
this.mailServerManager = mailServerManager;
this.mailQueue = mailQueue;
this.velocityManager = velocityManager;
}
What is the problem with VelocityManager? As I understand VelocityManager is not defined in the Spring Context, but it was in previous version, what can I do to add it?
pom.xml
<?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>xx.xxx.jira.plugins</groupId>
<artifactId>mail-handler</artifactId>
<version>1.0-SNAPSHOT</version>
<organization>
<name>Nane</name>
<url>http://</url>
</organization>
<name>Extended Mail Handler</name>
<description>
Provides basic "Create Issue or Comment Handler" functionality with additional features supported.
</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<!--JIRA Plugin dependencies-->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<!--Mail handler plugin dependencies-->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-mail-plugin</artifactId>
<version>${jira.mail.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.mail</groupId>
<artifactId>atlassian-mail</artifactId>
<version>4.0.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jta</groupId>
<artifactId>jta</artifactId>
<version>1.0.1b</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>
</Export-Package>
<!-- Add package import here -->
<Import-Package>
*
</Import-Package>
<!-- Ensure plugin is spring powered -->
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jira.version>7.12.1</jira.version>
<amps.version>6.3.21</amps.version>
<jira.mail.version>10.0.13</jira.mail.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
If we look at the source of Jira, in ContainerRegistrar:
register.implementation(PROVIDED, VelocityManager.class, JiraVelocityManager.class);
The PROVIDED scope means that the component is published via OSGi.
Indeed I can create a trivial Jira plugin which imports a VelocityManager:
#Inject
public MyPluginComponentImpl(final ApplicationProperties applicationProperties, #ComponentImport VelocityManager velocityManager) {
this.applicationProperties = applicationProperties;
this.velocityManager = requireNonNull(velocityManager);
}
and setting a breakpoint in the constructor, see that an instance of JiraVelocityManager is being injected.
This is in Jira 8.13.2.
So what you are seeing shouldn't happen.
Can you add your pom.xml to your question, in particular the jira-maven-plugin configuration?
Also, check http://localhost:2990/jira/plugins/servlet/upm/osgi (substituting wherever your Jira is running) and check that the system bundle, Registered services section contains something like Service 501 com.atlassian.velocity.VelocityManager (the number might be different)
this is my environment.
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Apache Maven 3.5.4
Nexus 2.14.8-01
Jenkins 2.136
my issue is I cannot perform a mvn clean deploy in Jenkins without it issuing error. the error:
[WARNING] The POM for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 is missing, no dependency information available
[ERROR] Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 in http://137.27.68.182:8082/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of ge-ip-nexus has elapsed or updates are forced -> [Help 1]
I'm rather new, and each experience brings me closer, but, I'm baffled.
In Nexus Maven Central, I look in Nexus repo, and under Browse Index, the maven-deploy-plugin:jar:2.7 exists, however, under browse storage, only 2.8.2 exists.
I'm not specifying or to my knowledge a specific version and wonder why doesn't it just use the maven-deploy-plugin:jar:2.8.2 ??? instead of the 2.7. and I can't find where the 2.7 is being declared. ??
thank you any suggestions on how to resolve or explain what the heck is going on would be much appreciated, IOU beer and more beer. :)
SETTINGS FOR JENKINS
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- The path to the local repository -->
<localRepository>/Users/212555427/devel/maven/repositories/ge-ip-jenkins-repository</localRepository>
<offline>false</offline>
<servers>
<server>
<id>com.ge.ip.snapshot.local</id>
<username>xxxxx</username>
<password>xxxxxx</password>
</server>
</servers>
<mirrors>
<mirror>
<id>ge-ip-nexus</id>
<name>Nexus Repository Manager</name>
<mirrorOf>*,!jbossRepos(x)</mirrorOf>
<url>http://137.277.686.182:8082/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<!-- A definition of a development profile -->
<profile>
<id>development</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>com.ge.ip.release</id>
<name>Release Repository</name>
<url>http://137.277.686.182:8082/nexus/content/groups/public</url>
</repository>
<!-- The specified location of where all snapshot artifacts are retrieved from. -->
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>com.ge.ip.snapshot</id>
<name>Snapshot Repository</name>
<url>http://137.277.686.182:8082/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<!-- The specified location of where all released plugins are retrieved from. -->
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>com.ge.ip.plugin.release</id>
<name>Plugin Release Repository</name>
<url>http://137.277.686.182:8082/nexus/content/groups/public</url>
</pluginRepository>
<!-- The specified location of where all snapshot plugins are retrieved from. -->
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>com.ge.ip.plugin.snapshot</id>
<name>Plugin Snapshot Repository</name>
<url>http://137.277.686.182:8082/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!-- Specify the default active profile. -->
<activeProfiles>
<activeProfile>development</activeProfile>
</activeProfiles>
</settings>
POM:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ge.digital.fleet</groupId>
<artifactId>ge.digital.fleet.parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>DIGITAL Fleet Parent</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<compiler.source.version>1.8</compiler.source.version>
<compiler.target.version>1.8</compiler.target.version>
<!-- JBoss Fuse Properties -->
<jboss.fuse.bom.version>6.3.0.redhat-310</jboss.fuse.bom.version>
<jboss.fuse.install>6.3.0.redhat-310</jboss.fuse.install>
<!-- Versions pulled from JBoss Fuse BOM for Dependency Management. -->
<cxf-version>2.17.0.redhat-630310</cxf-version>
<camel-version>2.17.0.redhat-630310</camel-version>
<activemq-version>5.11.0.redhat-630310</activemq-version>
<karaf-version>2.4.0.redhat-630310</karaf-version>
<hawtio-version>1.4.0.redhat-630310</hawtio-version>
<fabric-version>1.2.0.redhat-630310</fabric-version>
<junit-version>4.11</junit-version>
<log4j-version>1.2.17</log4j-version>
<velocity-bundle-version>2.17.0.redhat-630310</velocity-bundle-version>
<velocity-version>2.17.0.redhat-630310</velocity-version>
<joda-time-version>2.9.2</joda-time-version>
<!-- Versions of 3rd Party Dependencies -->
<ibm-mq-version>7.5.0.8</ibm-mq-version>
<!-- Test Dependencies -->
<ftpserver-version>1.0.6</ftpserver-version>
<sshd-version>0.10.0</sshd-version>
<greenmail-version>1.4.0</greenmail-version>
<!-- Plugin Versions-->
<version.maven-compiler-plugin>2.5.1</version.maven-compiler-plugin>
<bundle-plugin-version>2.3.7</bundle-plugin-version>
<build-helper-plugin-version>1.8</build-helper-plugin-version>
<resources-plugin-version>2.4.3</resources-plugin-version>
<felix-bundle-plugin-version>2.3.7</felix-bundle-plugin-version>
<lifecycle-mapping-version>1.0.0</lifecycle-mapping-version>
<maven-failsafe-plugin-version>2.8.1</maven-failsafe-plugin-version>
<depends-maven-plugin-version>1.2</depends-maven-plugin-version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Import Fuse Dependency Management via BOM -->
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>${jboss.fuse.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>jcifs</groupId>
<artifactId>jcifs</artifactId>
<version>1.3.17</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda-time-version}</version>
</dependency>
<!-- Spring Dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.2.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.7.21</version> <!-- 5.7.21 5.1.27-->
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.dom4j</artifactId>
<version>1.6.1_5</version>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.poi</artifactId>
<version>3.9_2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-bindy</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-csv</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<configuration>
<source>${compiler.source.version}</source>
<target>${compiler.target.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<!--
TODO
The url needs to be updated to the Corporate Nexus Instance.
This includes the hostname, port, and directory structure.
The <id> must match the <server> id in the settings.xml.
The settings.xml will contain the username/password.
Also note that only Jenkins should be doing the deploy, therefore
developer settings.xml SHOULD NOT contain the user name / password
of the <server>
-->
<distributionManagement>
<repository>
<id>com.ge.ip.snapshot.local</id>
<name>GE IP Releases</name>
<url>http://137.277.686.182:8082/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>com.ge.ip.snapshot.local</id>
<name>GE IP Snapshots</name>
<url>http://137.277.686.182:8082/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
Does a direct download work?
http://137.27.68.182:8082/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.17.pom
If it doesn't, examine the nexus.log file. You'll likely find the network connection from Nexus to Maven Central isn't working for some reason (e.g., it may be getting blocked by your firewall).
well, the reason for inability to access repos in nexus is due to company vpn security - not sure if it is the proxy or certs at this point.
but, If anyone knows how Maven determines the plugin releases or versions please post an answer. for instance if you simply issue a mvn clean deploy - how does maven know to pick deploy plugin 2.7 or 2.8 ?
thank you!
Specify a version/release for deployment plugin
clean package org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
I just formatted my laptop, and install everything fresh and new. But now I am unable to start Jira.
Here is the error message I get:
The POM for com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:jar:1.2.6 is missing, no dependency information available
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.428s
Finished at: Fri Nov 20 08:18:15 IST 2015
Final Memory: 11M/166M
------------------------------------------------------------------------
Plugin com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:1.2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:jar:1.2.6: Failure to find com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:pom:1.2.6 in 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 -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
and this is my pom.xml:
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-runtime</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugins.rest</groupId>
<artifactId>atlassian-rest-common</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>false</enableFastdev>
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<Export-Package>net.gisnas.jira.mailqueue.api,</Export-Package>
<Import-Package>org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
<version>1.2.6</version>
<executions>
<execution>
<goals>
<goal>atlassian-spring-scanner</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.local.repo>C:\Applications\Atlassian\atlassian-plugin-sdk-6.1.0\repository</maven.local.repo>
<jira.version>7.0.2</jira.version>
<amps.version>6.1.2</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.6</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<!-- TestKit version 6.x for JIRA 6.x -->
<testkit.version>6.3.11</testkit.version>
</properties>
Sometimes the above error is throwing, and sometimes I am facing jta.jar error even I don't understand why that jar is required. I tried with cloning the repo and starting it, but I'm still facing the same error.
Please add into your project pom.xml, following
<pluginRepositories>
<pluginRepository>
<id>atlassian-public</id>
<url>https://maven.atlassian.com/content/repositories/atlassian-public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</pluginRepository>
</pluginRepositories>
atlassian-spring-scanner-maven-plugin of course is Maven plugin of Atlassian. It should be hosted in Atlassian Maven Repositories - https://maven.atlassian.com/#nexus-search;quick~atlassian-spring-scanner-maven-plugin. But I see this error message:
Failure to find com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:pom:1.2.6 in http://repo.maven.apache.org/maven2
It says that it can not be looked up in Maven Central Repositories instead of Atlassian Maven Repositories
So I think you should check your Maven runtime settings. Your maven should read local settings.xml from Atlassian plugin SDK which configured Atlassian Maven Proxy, please refer this resource for configuration Atlassian Maven Proxy https://developer.atlassian.com/docs/advanced-topics/working-with-maven/atlassian-maven-repositories
I see your pom.xml has maven.local.repo
<maven.local.repo>C:\Applications\Atlassian\atlassian-plugin-sdk-6.1.0\repository</maven.local.repo>
But it just means that you are using a custom local repository directory, it does not mean your Maven has Atlassian Maven Proxy yet
I have a multi module maven project for e.g.
A
B
C
D
E
Currently this project is working fine and have a single job to build all the modules and upload to the artifactory with some version for e.g. 4.0.0-.They are using versions:set -DnewVersion=4.0.0-${BUILD_NUMBER} from Jenkins job.Now my next task is to split this project into module so they dev team can build each module independetly but my issue is some modules is having the dependecy on other modules for e.g
Module B is having dependecy on module A and Module C.if I build the module A first then it generate the number 4.0.0-00001 and upload it to the artifactory and then I build the module C then it generate the build 4.0.0-00005.Now the question comes how could I build the module B which is having the dependency on module A and C.In my opinion I need to define the version of module A and C explicitly in the dependency section.
<dependency>
<groupId>com.xyz.engine</groupId>
<artifactId>A</artifactId>
<version>4.0.0-00005</version>
</dependency>
From my module POM I am calling my parent POM and In jenkins job I am giving
versions:set -DnewVersion=4.0.0-${BUILD_NUMBER} for versioning purpose if I explicity define the version of A module then it is also passing the same value to the Parent POM and searching for it which is not avilable.Below is my module POM file
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.truvenhealth.analyticsengine</groupId>
<artifactId>AnalyticsEngine</artifactId>
<version>4.0.0-00002</version>
</parent>
<artifactId>LicenseVerifier</artifactId>
<name>LicenseVerifier</name>
<packaging>jar</packaging>
<dependencies>
<!-- Modules dependencies -->
<dependency>
<groupId>com.xyz.engine</groupId>
<artifactId>Common</artifactId>
<version>4.0.0-00007</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<!-- External dependencies -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>com.verhas</groupId>
<artifactId>license3j</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<!-- Plugin configurations inherited from the parent POM -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
it is taking the same value for Parent POM which I assigned to Common module .I am keeping the Parent POM in separate repository it should not take the same value it should only take that value which I am defining for the Parent POM and it should download it from their and provide all the values to module POM and the build should be created for module LicenseVerifier with different version.
If you have a multi module build which looks like this:
root (pom.xml parent of all modules)
+---- module-a (pom.xml)
+---- module-b (pom.xml)
+---- module-c (pom.xml)
+---- module-d (pom.xml)
To build a module separately you can do this via Maven like this:
mvn -pl module-a clean package
This will build the module-a only and get the dependencies of other modules from the remote repository. Or you can enhance that like this:
mvn -pl module-a -amd clean package
where the option -amd means --also-make-dependents. If a developer needs a particular state you can do this by a mvn install first and afterwards only build the module you would like to build.
A very important thing in relationship with multi module builds is to have the same version for all modules and the parent. So dependencies between those modules is no problem.
Starting with Maven 3.2.1 you can define the version via properties.
A simple change to prevent Maven from emitting warnings about versions
with property expressions. Allowed property expressions in versions
include ${revision}, ${changelist}, and ${sha1}. These properties can
be set externally, but eventually a mechanism will be created in Maven
where these properties can be injected in a standard way. For example
you may want to glean the current Git revision and inject that value
into ${sha1}. This is by no means a complete solution for continuous
delivery but is a step in the right direction.
Furthermore during development i would prefer the SNAPSHOT versions which the cleanup in the repository manager simpler. So in essence i don't any need to separate the modules which logicaly belong together.
Apart from that if you use the same version within your multimodule build you can use things like this: ${project.version} to define the version of a dependency which is part of the reactor.
I encounter a very strange problem with Maven and Eclipse compiler.
While in Eclipse+m2eclipse, I have no problem compiling a small project (archetype quick start) with the following single class.
package test.test;
import com.Ostermiller.util.CSVParser;
public class TestCaseSensitive {
CSVParser csvParser;
}
Ostermiller utils is added to pom.xml. Eclipse Kepler compiles the project.
Next, mvn compile works out-of-the-box.
Now the issue, I switch to compiler 3.1 and asks for Eclipse compiler (to be able to handle same compilation issues in console mode as well as IDE mode). This is the POM :
<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>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ostermiller</groupId>
<artifactId>utils</artifactId>
<version>1.07.00</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.7</source>
<target>1.7</target>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<fork>false</fork>
<compilerArgument>-err:nullAnnot,null</compilerArgument>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
And now here is the result :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test: Compilation failure: Compilation failure:
[ERROR] /home/me/workspaces/4/3/ws/test/src/main/java/test/test/TestCaseSensitive.java:[3] The import com.Ostermiller cannot be resolved
[ERROR] /home/me/workspaces/4/3/ws/test/src/main/java/test/test/TestCaseSensitive.java:[7] CSVParser cannot be resolved to a type
The package com.Ostermiller exists (it compiles in maven default compiler as well in Eclipse IDE), but not after switching to eclipse compiler.
Please note that the reported error path is also wrong :
[ERROR] /home/me/workspaces/4/3/ws/test/src/main/java/...
should be
[ERROR] /home/me/workspaces/4.3/ws/test/src/main/java/...
Has someone an idea? Where shall the potential bug be reported?
Have you tried using the jdt compiler provided by tycho?
See http://wiki.eclipse.org/Tycho/FAQ#Can_I_use_the_Tycho_compiler_support_in_non-OSGi_projects.2C_too.3F
That'd give you :
<plugin>
<!-- Use compiler plugin with tycho as the adapter to the JDT compiler. -->
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>jdt</compilerId>
<source>1.7</source>
<target>1.7</target>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<fork>false</fork>
<compilerArgument>-err:nullAnnot,null</compilerArgument>
</configuration>
<dependencies>
<!-- This dependency provides the implementation of compiler "jdt": -->
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>${tycho-version}</version>
</dependency>
</dependencies>
</plugin>
Currently tycho-version=0.18.0