I am working on Drolls 6.1.0.Final. And my LATEST assets are not getting loaded. We have created a kJar 1.0 with 5 rules in KIE-Workbench 6.1.0.Final. We start our application server with KContainer having ReleaseId(gtoup, Artifact , LATEST). Rules are firing. Now add another rule in workbench increment the kJar version 1.1 and perform build and deploy. After waiting for 5mins fire the rules in application, LATEST Version IS NOT downloaded in m2 local repo and old rules are getting fired. I even tries with setting maven's update policy as interval:1, but in vain.
KIE Scanner is only getting triggered if I manually change the latest version and last updated in metadata.xml in local m2 repo. In this case KIE Scanner loads the new rules.
Kindly let us know what needs to be done.
Similar Issue
https://issues.jboss.org/browse/DROOLS-477
I know its old post but may be useful for others.
LATEST will not update rule at runtime instead it will load kjar from your local. So try to increase version number or use SNAPSHOT like 1-SNAPSHOT. When you use version as SNAPSHOT everytime it will check latest kjar.
Also check below settings.xml.
<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">
<servers>
<server>
<id>uf-playground</id>
<username>root</username>
<password>root</password>
<configuration>
<wagonProvider>httpclient</wagonProvider>
<httpConfiguration>
<all>
<usePreemptive>true</usePreemptive>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>
<profiles>
<profile>
<id>profile-1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>uf-playground</id>
<name>Drools workbench</name>
<url>http://localhost:8080/kie-drool-6.4/maven2/</url>
**<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>**
</repository>
</repositories>
</profile>
</profiles>
</settings>
Related
I am in need to test my code against two target platforms (which can be wrong to start with, but I would like to keep the focus on the issue): Kepler and Luna.
To do this, I defined two repositories in my parent project:
<repositories>
<repository>
<id>kepler</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/kepler</url>
</repository>
<repository>
<id>luna</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/luna</url>
</repository>
</repositories>
Then I created two plugins, one for Kepler and one for Luna which declare two different dependencies (code is duplicated, but again this is a separate issue):
// Luna
Require-Bundle:
org.eclipse.e4.core.contexts;bundle-version="1.3.100"
// Kepler
Require-Bundle:
org.eclipse.e4.core.contexts;bundle-version="[1.3.0,1.3.100)"
Now, when I specify the adequate tycho.target-platform, through -D or settings.xml, and run the build with mvn clean install, one of these plugins always fails and the other one succeeds. Luna fails if I don't specify a Luna target, Kepler fails if I don't specify a Kepler target.
There must be a better way, I told myself, and I read about target-platform-configuration which I have configured with all the possible combinations of os/ws/arch.
But still it fails for one or the other. What am I doing wrong?
The problem is that you override your target platform configuration in the POM by using the deprecated -Dtycho.target-platform property. When that property is set, Tycho no longer uses the artifacts from the two p2 repositories that you have specified.
So, don't use this property (and also make sure that you don't set it your settings.xml) and your approach should work.
My answer came right after checking my ~/.m2/settings.xml:
<profile>
<id>tycho-kepler</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tycho.targetPlatform>/usr/local/share/eclipse</tycho.targetPlatform>
</properties>
</profile>
<profile>
<id>tycho-luna</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<tycho.targetPlatform>/usr/local/share/eclipse-luna</tycho.targetPlatform>
</properties>
</profile>
Apparently these lines, even without having specified -P or the profile in the build, are added to the execution, something that I didn't now. Removing them solved the problem immediately.
I am trying to find out code coverage on new lines only. I use jacoco report for IT coverage and run mvn sonar:sonar. Sonar does not display the new line code coverage.
I am not sure what configuration I am missing.It seems to work for svn repo. I run mvn sonar on the base version and again with the latest version.
I am using Perforce,SonarQube 4.4, SCM Activity Plugin 1.8.
Here is my POM.xml,
<scm>
<connection>scm:perforce:username#perforceserver:portnumber://depot</connection>
<developerConnection>scm:perforce:username#perforceserver:portnumber://depot</developerConnection>
<url>scm:perforce:username#perforceserver:portnumber://depot</url>
</scm>
<properties>
<skipTests>false</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.jacoco.itReportPath>C:/SonarData/ExecFiles/CSMmergeddata.exec</sonar.jacoco.itReportPath>
<sonar.scm.reloadBlame>true</sonar.scm.reloadBlame>
<sonar.language>java</sonar.language>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${acme-corporate-pom.sonarVersion}</version>
</plugin>
...
To have code coverage on new line information, SonarQube relies on information from the SCM engine. As you can see on the SCM Activity plugin matrix, Subversion is perfectly supported but not Perforce - which is only known to be tested by some users but not formally validated by SonarQube team as "supported".
So either:
your configuration of the SCM Activity plugin is not correct
See the "Additional configuration for Perforce" section of the documentation of this plugin
or you hit a bug in the implementation of the Maven SCM library (we know there are some bugs)
See all the open bugs on this lib
I'm using Maven's settings.xml to override a property value for a log4j.properties file for development purposes. However, after I made this change, I now receive warnings in Eclipse m2e even though this is a normal use case:
Access "/Users/junger/.m2" directory outside of project base
directory.
(org.apache.maven.plugins:maven-resources-plugin:2.5:resources:default-resources:process-resources)
How do I remove this warning? Or, is there a bug tracking this? I couldn't find one.
In my pom.xml, I have -
<properties>
<log4j.properties.directory>src/main/java</log4j.properties.directory>
</properties>
In my settings.xml, I have -
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<log4j.properties.directory>/Users/junger/.m2/</log4j.properties.directory>
</properties>
</profile>
</profiles>
Looking at the code (the newScanner() method) of m2e, this seems to be an explicit warning when your project references files outside of its base directory.
For me, this warning is kind of justified. When you are referencing resources outside of your project's basedir, your builds might not be reproducible anymore. Your projects should rather be self contained without depending on external files.
I've been given the task of migrating an existing project -- formerly built with Ant -- to use Apache Maven. I'm brand new to the entire concept, though I've spent the last several hours doing as much research as I can on the subject. Sadly, I'm having some proxy issues when it comes to installing things like m2e and Eclipse IAM, so everything must be done from the command prompt. As of right now, I do have maven installed properly; the trick now is to use it in my project rather than Ant. I've looked online and found a few tutorials, but they are all too vague for me considering my lack of experience with all of this. If anyone can break the steps down for me one-by-one in a detailed manner, that would be more than amazing. On a side note, I've been told to add the following to the local Maven Settings:
<settings>
<servers>
<server>
<id>local_tomcat</id>
<username>admin</username>
<password>tomcat</password>
</server>
<server>
<id>artifactory</id>
<username>user</username>
<password>password</password>
</server>
</servers>
<mirrors>
<mirror>
<id>artifactory</id>
<name>Artifactory</name>
<url>https://jenkins.web.jw.local/artifactory/repo1</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.jw.local</host>
<port>80</port>
<username>user</username>
<password>password</password>
<nonProxyHosts>*.jw.local</nonProxyHosts>
</proxy>
</proxies>
</settings>
With the obvious username and password information filled in. I think I've managed that thus far by simply adding the necessary blocks into the settings.xml file under my ApacheMaven\conf directory. Other than that single step, I'm pretty much lost. Again, any help, especially that of a detailed tutorial in terms of command line instructions to build this project would be wonderful. Oh, and on another side-note, I am using Eclipse... Not sure if that would matter much.
EDIT: Considering Petr Kozelka's answer, I've attempted to make a pom.xml file for my project. Here's what I have so far...
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>appName</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>Application Name</name>
<description>Yadda Yadda</description>
<build>
<plugins>
</plugins>
</build>
<dependencies>
</dependencies>
<repositories>
</repositories>
</project>
Is this heading in the right direction? Also, do I need to construct the archetype.xml file myself, or will Maven do that through the command line somehow? If I need to do it myself, this is what I've come up with thus far:
<archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0 http://maven.apache.org/xsd/archetype-1.0.0.xsd">
<id>lighthouse</id>
<sources>
<source>src/com/jeldwen/lighthouse/controller/AddTimeController.java</source>
<source>src/com/jeldwen/lighthouse/controller/BugController.java</source>
<source>src/com/jeldwen/lighthouse/controller/DeleteTimeController.java</source>
<source>src/com/jeldwen/lighthouse/controller/EnterTimeController.java</source>
<source>src/com/jeldwen/lighthouse/controller/ModifyTimeController.java</source>
<source>src/com/jeldwen/lighthouse/controller/PersonController.java</source>
<source>src/com/jeldwen/lighthouse/controller/ProjectController.java</source>
<source>src/com/jeldwen/lighthouse/controller/TimeController.java</source>
<source>src/com/jeldwen/lighthouse/model/Area.java</source>
<source>src/com/jeldwen/lighthouse/model/Bug.java</source>
<source>src/com/jeldwen/lighthouse/model/DBModel.java</source>
<source>src/com/jeldwen/lighthouse/model/DefaultModel.java</source>
<source>src/com/jeldwen/lighthouse/model/JWModel.java</source>
<source>src/com/jeldwen/lighthouse/model/JWTime.java</source>
<source>src/com/jeldwen/lighthouse/model/Person.java</source>
<source>src/com/jeldwen/lighthouse/model/Project.java</source>
<source>src/com/jeldwen/lighthouse/util/Lighthouse.java</source>
<source>src/com/jeldwen/lighthouse/util/LighthouseApplicationListener.java</source>
<source>src/com/jeldwen/lighthouse/util/LighthouseServlet.java</source>
<source>src/com/jeldwen/lighthouse/util/LighthouseSystemProperties.java</source>
<source>src/com/jeldwen/lighthouse/LighthouseApp.java</source>
</sources>
<testSources>
<!-- None -->
</testSources>
<allowPartial>true</allowPartial>
</archetype>
First of all: if you wish to customize settings.xml, do not touch the one in maven distro - instead, create a new file in $HOME/.m2/settings.xml where maven finds and uses it.
As the very first step, I recommend you to not use settings.xml at all.
Create a supersimple maven project, and try to compile it:
mvn clean install
Second step
Use very simple settings.xml:
you probably do not need proxy
servers part is needed only for publishing artifacts to a maven repository; that's not important at the beginning
here it is:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<mirrors>
<mirror>
<id>repos</id>
<mirrorOf>*</mirrorOf>
<name>internal mirror</name>
<url>https://jenkins.web.jw.local/artifactory/repo1</url>
</mirror>
</mirrors>
<!-- TODO: the proxy part here -->
</settings>
This assumes that you use inhouse maven repository, for instance Nexus or Artifactory.
Using maven repo makes only sense if your projects are not happy with deps available in the Maven Central Repository - otherwise, you can safely go without it. (let's neglect the performance effect of repoman for now)
Now, add some java sources, dependencies etc. - and watch how new depenencies get automatically downloaded to your local repository...
Third step
Learn how to add further repositories to your repository manager (group "public" on Nexus)...
The rest is probably subject of further research.
I've tried to build Tycho now for a couple of hours and just can't get it to work. I've followed these instructions:
https://docs.sonatype.org/display/TYCHO/BuildingTycho
So, I've downloaded Eclipse 3.6RC2 and Delta-packs linked from this instruction (is it for 3.5 only?):
http:// (remove space) aniefer.blogspot.com/2009/06/using-deltapack-in-eclipse-35.html
I've added the DeltaPack to the TargetPlatform inside of the Eclipse-installation.
I've installed Maven: Apache Maven 3.0-beta-1 (r935667; 2010-04-19 19:00:39+0200)
I can run the first bootstrap of the build, but the second fails:
mvn clean install -e -V -Pbootstrap-2 -Dtycho.targetPlatform=$TYCHO_TARGET_PLATFORM
ERROR] Internal error: java.lang.RuntimeException:
Could not resolve plugin org.eclipse.core.net.linux.x86_null -> [Help 1]
I've tried different stuff, I built an older revision against 3.5 as in this blogpost:
http:// (remove space) divby0.blogspot.com/2010/03/im-in-love-with-tycho-08-and-maven-3.html
and that actually built a running maven, but that version then can't find the tycho plugin:
org.apache.maven.plugin.version.PluginVersionResolutionException: Error resolving version for plugin 'org.codehaus.tycho:maven-tycho-plugin' from the repositories [local (/Users/viktor/.m2/repository), central (http://repo1.maven.org/maven2)]: Plugin not found in any plugin repository
I thought that the point was that the plugin was going to build in when I had built a Tycho-dist…?
Sorry about the links, stackoverflows spam-protection doesn't let me post more than one url yet
The Tycho documentation is pretty bad, to set the record straight, Tycho is included in the Maven repositories by default now; declaring it in your POM will automatically download it and allow you to use it.
To cut to the chase, this is all you have to put in your Maven POM to use Tycho, and then next time Maven uses this POM for a project, it will get Tycho if you don't already have it and use it for the build. At the time of this writing, 0.12.0 is the latest stable release.
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.12.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Now, say, you would like to use an "unstable" Tycho, like <version>0.13.0</version>. Then you would want to change the version number in the plugin to the appropriate value, and then add this (The latest Tycho repository) to your POM:
<pluginRepositories>
<pluginRepository>
<id>sonatype-release</id>
<url>http://repository.sonatype.org/content/groups/sonatype-public-grid
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
That simple.
With the move to eclipse.org, we also invested in better documentation for contributors:
http://wiki.eclipse.org/Developing_Tycho
http://wiki.eclipse.org/Tycho/Contributor_Guide