Perforce+Sonar setup for New line code coverage - version-control

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

Related

Error "Source option 5 is no longer supported. Use 6 or later" on Maven compile

I am getting the following error on $ mvn compile:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Sym360: Compilation failure: Compilation failure:
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] -> [Help 1]
Here is the code of my 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>com.test.app</groupId>
<artifactId>Tset</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Test</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<!-https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-
java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
I tried to add properties in the pom.xml code, but still getting the same error.
What helped me was these lines in pom.xml file
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
I had same issue, the problem is with properties. Check your JavaSE version in your project, it will be displayed beside JRE System Library folder in your project. If it is 1.5, then it will throw an error. Most probably you will have a updated version, so check the version and update it. I have updated it below based on your code.
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
Also in one of my IntelliJ IDEA projects, in addition to all of answers above, another try works:
Just change Language level in Modules section of Project Structure [image below]
I had same issue and i have added below configuration in pom.xml and it works.
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
I think you have wrong your pom.xml:
<properties>
<maven.compiler.source>6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
change to:
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
Now depending if you are using the command line use:
mvn clean compile
or either way(eclipse ide)
Right click on project Run with maven>build>Goal (compile)
In Eclipse This helped me:
Right Click on Project.
Click on Build path.
Click on Configure Build path.
It opens a Java Build path window.
Click on Java Compiler in the Left side.
It navigates to Java Compiler window in that to set the Compiler compliance level is set as according to your jre version(ex if java version is 1.8
then choose 1.8) as select.
Click on [Apply] button.
Click on [OK] button.
Right click on Project > Maven > Update the project.
Right click on Project > Run As > Maven install -- The pom.xml file is running and java jars are download and installed to project.
Right click on Project > Run As > Maven Test -- The pom.xml file is running and java jars are download and installed to project.
Then you got the Build Success message and your maven project is created successfully.
adding below code in pom will resolve the issue
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<profiles>
I was facing the same issue and resolved it with the lines of code below:
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
I fixed this by adding this in pom.xml file:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
For the new Apache net Bean its a little bit different from the suggestion by SUPARNA SOMAN
Right Click on your Project
-Hover on "set configuration" and click customize configuration
-.A new dialogue box opens....
At the left corner where the categories are, Click on "Source"
At the select form on the page below, select your required version of JDK ----see image for this last step.the last step required to change jdk version
On MacOS I have multiple versions
user> ls /Library/Java/JavaVirtualMachines/
jdk-11.0.4.jdk jdk-12.0.2.jdk jdk1.8.0_221.jdk
and JAVA_HOME was not defined properly so Maven used jdk-12. I have jdk-11,jdk-8, and jdk-12.
user> mvn -version
Apache Maven 3.6.1
Maven home: /usr/local/Cellar/maven/3.6.1/libexec
Java version: 12.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
Default locale: XXX, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
So:
Define JAVA_HOME to use jdk-8.
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home
Try again, now maven is:
user> mvn -version
Maven home: /usr/local/Cellar/maven/3.6.1/libexec
Java version: 1.8.0_221, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre
and the build is:
[INFO] BUILD SUCCESS
None of the solutions above worked for me.
For some reasons the file with the name of my project.iml had changed. Found the difference in the previous subversion repository submission...
In projectname.iml I found this line:
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_5">
And all I had to do was changing it to 11
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
After so many years, happily seeing the same error ! :P
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
pom.xml did not have any source or target declarations, so maven must have taken some archaic versions as default, rather than being clever enough to get it from the install JVM (which is currently on 18).
So, without knowing the original issue, I could also resolve it through the below snippet below. That declares a specific source and target version, which subpresses the problem.
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>18</source>
<target>18</target>
</configuration>
</plugin>
</plugins>
</build>
Some people have asked:
I understand that this works, but I don't understand why maven uses a default source value that it does not support? –
The answer is:
Maven doesn't know what version of the JDK you will use.
When used with JDK 1.8 Maven compiles work successfully.
When using newer versions of the JDK, it's not clear what version of the byte code you want to use. So Maven's has punted and continues use what it has used for many years.
At this day and age, it is difficult for Maven (as a generic build tool) to select a default byte code version that everyone will like.
So it's probably best to get used to putting the version of your source code and the byte code you want to generate in your pom.xml file.
You can argue (and I would agree) that maven should (by default) use a newer version of the maven-compiler-plugin but as I stated, whatever version was picked, someone would have a problem with it.
Example
For example, if you use JDK 11, you might very well be using Java 11 syntax and need -source 11 -target 11 when compiling your code.
Even the most recent release of the plugin maven-compiler-plugin:3.10.1 defaults to JDK 1.7 syntax which would result in compilation errors for Java 11 code.
A full description of the problem
Other's have said this, but to be complete. The default pom.xml doesn't specify the maven-compiler-plugin. To find out the version used you can use
mvn help:effective-pom | more
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
You'll see that the maven-compiler-plugin:3.1 is being used.
You can see that this version generates a command with -target 1.5 -source 1.5 which generates an error when used with versions of Java newer than Java 1.8.
The following shows the error that occurs when using JDK 17.
mvn --version
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: D:\p\apache-maven-3.8.6
Java version: 17.0.2, vendor: Oracle Corporation, runtime: D:\p\jdk-17.0.2
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
mvn clean install -X
. . .
[DEBUG] -d D:\Play\maven\helloworld\target\classes -classpath D:\Play\maven\helloworld\target\classes; -sourcepath D:\Play\maven\helloworld\src\main\java; -g -nowarn -target 1.5 -source 1.5
. . .
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[INFO] 2 errors
The fix
The fix was to update the maven pom.xml file to specify either a newer maven-compiler-plugin. I tested with maven-compiler-plugin:3.10.1 and it uses -target 1.7 -source 1.7
The syntax is:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
</plugins>
</build>
At the time of this writing version 3.10.1 was the latest version.
The other option is to specify the version of the byte code you want to generate, one way is to use this (as stated in another answer):
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
This will work even with the old version 3.1 plugin.
Here is the solution which helped me:
I had the same issue on error source option 5 is no longer supported, Use 6 or later
So i followed these instructions and problem SOLVED
Open Project Properties (File Menu)
Change the Source / Binary Format to the latest version (JDK 7 in my case)
Project Properties
Source / Binary Format
Clean and Build, Then Run the project
This is a message from a newer javac, e.g.:
$ java -version
openjdk version "11" 2018-09-25
$ javac -source 1.5 -target 1.5 Test.java
error: Source option 5 is no longer supported. Use 6 or later.
error: Target option 1.5 is no longer supported. Use 1.6 or later.
So, apparently you're using a newer JDK version with a Maven version prior to 3.8.0 ("<source>/<target> ... NOTE: Since 3.8.0 the default value has changed from 1.5 to 1.6"). The maven-compiler-plugin:3.1 you use is from April 2013.
There are two possibilities:
Update your Maven version to the latest (I'd recommend that)
Setting the Java Version in Maven:
2.2. Java 9 and Beyond
...
<properties>
<maven.compiler.release>...</maven.compiler.release>
</properties>
If in Eclipse, Write click on project and go to properties. Search for maven and configure a jdk higher version (1.7 onwards) there and apply. Now try maven install.
In my case, running MacOS Big Sur and JDK version 15, I added the code below in pom.xml file shown below. I added the 15 for my JDK version.
<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
I then re-ran $ mvn clean wildfly:deploy and it worked.
Both options work for me to resolved Source option 5 is no longer supported. Use 6 or later” on Maven compile
Open pom.xml file
Option1: add build tags
Option2: add properties tags
<project>
<groupId>com.pluralsight</groupId>
<artifactId>HelloWorld</artifactId>
<version>1.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>12</release>
</configuration>
</plugin>
</plugins>
</build>
</project>
OR
<project>
<groupId>com.pluralsight</groupId>
<artifactId>HelloWorld</artifactId>
<version>1.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
</project>
I faced the same challenge, what I did was to go to:
File
Project structure
Module
Changed compile SDK to 30 (Latest at the time)
Build tools 30.0.3 (Latest)
Source compatibility (1.8 Java 8)
Target compatibility (1.8 Java 8)
Change the
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
to
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
Set updated java version from build path as per you installed
I solve the problem by finding that my $JAVA_HOME is empty. After setting it, compilation succeeded!

Eclipse plugin with Maven dependencies for third party libraries

I am converting Subclipse to build with Eclipse Tycho and Maven.
Subclipse depends on a few third party JAR files that are not Eclipse plugins so do not exist in any p2 repository. Currently, I just include these in a lib folder within the plugin.
Since these JAR files do exist in Maven, I was hoping that by converting the plugins to build with Maven I could use Maven dependencies. IOW, the plugin would have a pom.xml where I used Maven dependencies to grab and include the third party jar's that have to be included in the plugin. Basically, it would just automate having to refresh what I include in the lib folder of the plugin.
Is this possible? I tried doing what I said above by when I build, I saw no sign that Maven/Tycho was trying to fetch the dependencies. I imagine it is because when the packaging is eclipse-plugin it looks solely at the Eclipse configuration files for the dependency information.
Thanks
To add plain (without OSGi metadata) jar files into your folder at biuild time, you can specify an <execution> of the maven-dependency-plugin to fetch them. However it will require to update your MANIFEST.MF Bundle-Classpath directive whenever a version changes.
It's usually better to hunt for OSGi-able jars or to make an extra effort to package existing libs as OSGi bundles/p2 artifacts like Eclipse Orbit or JBoss Tools Locus do.
Did you try doing the following after adding the dependencies to the pom.xml file?
Project->Clean
Right click on project: Maven->Update dependencies
Right click on project: Maven->Update project configuration
Just adding the plugin to pom dependencies and including the entry <pomDependencies>consider</pomDependencies> in the configuration of target-platform-configuration makes it work.
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<!-- The configuration to make tycho consider the maven dependencies -->
<pomDependencies>consider</pomDependencies>
<!-- other configurations -->
</configuartion>
</plugin>
<!-- other plugins-->
</plugins>
<dependencies>
<!-- An example third-party bundle (plugin) present in maven repository-->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.gogo.shell</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
Reference link here.

m2e error in MavenArchiver.getManifest()

I am seeing an error in my STS and am not sure how to debug it. Searching around I only see vague references to the error and no solutions.
The error is:
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) pom.xml /<maven projectName> line 1 Maven Configuration Problem
Question: Can anyone give any suggestions on how to get more information on the issue in order to debug it further or any possible solutions?
Maybe some more context on what the functionality of method is. The javadoc associated with the MavenArchiver.getManifest() method is not very detailed and there is no stack trace that I see. I've tried several refreshes and updates of the project and associated projects including clearing my local m2 repo.
STS info:
Version: 3.7.3.RELEASE
Build Id: 201602250940
Platform: Eclipse Mars.2 (4.5.2)
m2e info:
Version: 1.6.2.20150902-0002
I encountered the same issue after updating the maven-jar-plugin to its latest version (at the time of writing), 3.0.2.
Eclipse 4.5.2 started flagging the pom.xml file with the org.apache.maven.archiver.MavenArchiver.getManifest error and a Maven > Update Project.. would not fix it.
Easy solution: downgrade to 2.6 version
Indeed a possible solution is to get back to version 2.6, a further update of the project would then remove any error. However, that's not the ideal scenario and a better solution is possible: update the m2e extensions (Eclipse Maven integration).
Better solution: update Eclipse m2e extensions
From Help > Install New Software.., add a new repository (via the Add.. option), pointing to the following URL:
https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
Then follow the update wizard as usual. Eclipse would then require a restart. Afterwards, a further Update Project.. on the concerned Maven project would remove any error and your Maven build could then enjoy the benefit of the latest maven-jar-plugin version.
Additonal notes
The reason for this issue is that from version 3.0.0 on, the concerned component, the maven-archiver and the related plexus-archiver has been upgraded to newer versions, breaking internal usages (via reflections) of the m2e integration in Eclipse. The only solution is then to properly update Eclipse, as described above.
Also note: while Eclipse would initially report errors, the Maven build (e.g. from command line) would keep on working perfectly, this issue is only related to the Eclipse-Maven integration, that is, to the IDE.
I found my answer! I looked into the pom for any plugins that have a dependency on the maven-archiver and found the maven-jar-plugin does. It was using the latest 3.0.0 version. When I downgraded to 2.6 it seems to fix the issue :-)
I had the same problem with a spring boot project. the solution was to downgrade the jar maven-jar-plugin from 3.2 to 2.6 . i had just to add this to the project pom:
<properties>
<maven-jar-plugin.version>2.6</maven-jar-plugin.version>
</properties>
I had exactly the same problem. My environment was:
Spring STS 3.7.3.RELEASE
Build Id: 201602250940
Platform: Eclipse Mars.2 (4.5.2)
The symptoms of the problems were:
There was a red error flag on my PM file. and the description of the error was as described in the original question asked here.
There were known compilation problems in the several Java files in the project, but eclipse still was not showing them flagged as error in the editor pane as well as the project explorer tree on the left side.
The solution (described above) about updating the m2e extensions worked for me.
Better solution (my recommondation):
update Eclipse m2e extensions
From Help > Install New Software.., add a new repository (via the Add.. option), pointing to the following URL: https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
Select the m2e extensions, accept the license.
After update, you will be asked for restarting STS. The problem goes away after STS comes back up.
I had the same problem with a spring boot project. The solution was to downgrade the spring-boot-starter-parent dependency version from 2.0.0.RELEASE to 1.5.10.RELEASE(you can move to any stable version)
from:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
to
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
I had also faced the same issue and it got resolved by changing the version from 3.2.0 to 2.6 as shown in below pom.xml snippet
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>Spring4MVC</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
Upgrade your m2e extensions instead downgrade.
From Help > Install New Software.., add a new repository (via the Add.. option)
Specify name for your plugin and add path http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/
once you are done with installation, please restart eclipse and update your project.
I also faced the similar issues, changing the version from 2.0.0.RELEASE to 1.5.10.RELEASE worked for me, please try it before downgrading the maven version
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
I solved this error in pom.xml by adding the below code
spring-rest-demo
org.apache.maven.plugins
maven-war-plugin
2.6
I had also faced the same issue and it got resolved by commenting the version element in POM.xml as show.
org.apache.maven.archiver.[MavenArchiver](https://maven.apache.org/shared/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiver.html).getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version>3.5.1</version> -->
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<!-- <version>3.1.0</version> -->
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
Use the steps given in this link. It worked for me.
Step - 1 Right click on your project in Eclipse
Step - 2 Click Properties
Step - 3 Select Maven in the left hand side list.
Step - 4 You will notice "pom.xml" in the Active Maven Profiles text box on the right hand side. Clear it and click Apply.
Step - 5 Run As -> Maven clean -> Maven Install
Hope it helps!

Using Maven's .m2/settings.xml throws warning in Eclipse m2e

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.

How do I build latest Tycho

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