javaee / hk2

A light-weight and dynamic dependency injection framework
https://javaee.github.io/hk2
Other
112 stars 83 forks source link

Cannot build hk2 from scratch without -DsurefireArgLineExtra="" #326

Closed glassfishrobot closed 8 years ago

glassfishrobot commented 8 years ago
  1. I fork hk2.
  2. I run mvn clean install.
  3. I observe the following:
[INFO] ------------------------------------------------------------------------
[INFO] Building HK2 API module 2.4.0-b33-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hk2-api ---
[INFO] Deleting /Users/LANELSON/Projects/github/hk2/hk2-api/target
[INFO] 
[INFO] --- osgiversion-maven-plugin:2.4.0-b33-SNAPSHOT:compute-osgi-version (compute-osgi-version) @ hk2-api ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ hk2-api ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hk2-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/LANELSON/Projects/github/hk2/hk2-api/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ hk2-api ---
[INFO] Compiling 121 source files to /Users/LANELSON/Projects/github/hk2/hk2-api/target/classes
[INFO] 
[INFO] --- maven-bundle-plugin:2.4.0:manifest (bundle-manifest) @ hk2-api ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hk2-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ hk2-api ---
[INFO] Compiling 72 source files to /Users/LANELSON/Projects/github/hk2/hk2-api/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.6:test (default-test) @ hk2-api ---
[INFO] Surefire report directory: /Users/LANELSON/Projects/github/hk2/hk2-api/target/surefire-reports
Error: Could not find or load main class ${surefireArgLineExtra}

The workaround is simple: add a -DsurefireArgLineExtra="" command line property. But this shouldn't be necessary.

Affected Versions

[2.3.0]

glassfishrobot commented 8 years ago

Reported by @ljnelson

glassfishrobot commented 8 years ago

@romain-grecourt said: what maven version are you using ?

glassfishrobot commented 8 years ago

@ljnelson said:

$ mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
Maven home: /usr/local/maven
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: ISO8859-1
OS name: "mac os x", version: "10.11.1", arch: "x86_64", family: "mac"
glassfishrobot commented 8 years ago

@romain-grecourt said: This is caused by the use of jdk8.

There is a jdk8 maven profile to handle the -Xdoclint javadoc param, so that profile is active when using jdk8. Another profile "noagent" has been added to declares surefireArgLineExtra as an empty property, and is expected to be active by default.

There can be only one active default profile, so instead of relying on this I just set the property at the top as Maven properties are not immutable like in ant.

The change has been pushed to the repo.

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA HK2-282

glassfishrobot commented 8 years ago

Marked as fixed on Tuesday, December 1st 2015, 7:42:34 am