Skip to content

Fix substitution in org.jacoco.ant/about.html #926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2019
Merged

Conversation

Godin
Copy link
Member

@Godin Godin commented Aug 24, 2019

Fixes #924

@Godin Godin added this to the 0.8.5 milestone Aug 24, 2019
@Godin Godin requested a review from marchof August 24, 2019 00:10
@Godin Godin self-assigned this Aug 24, 2019
@marchof
Copy link
Member

marchof commented Aug 24, 2019

Thanks for picking this up quickly! Here is something strange: When I run the build locally, replacement does not work at all (neither in *.html or in *.properties) and finally Ant tests fail:

 [java] Exception in thread "main" java.lang.NoClassDefFoundError: ${jacoco/runtime/package/name}/Offline
 [java] 	at org.jacoco.ant.TestTarget.$jacocoInit(TestTarget.java)
 [java] 	at org.jacoco.ant.TestTarget.main(TestTarget.java)
 [java] Caused by: java.lang.ClassNotFoundException: ${jacoco.runtime.package.name}.Offline
 [java] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
 [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 [java] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
 [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 [java] 	... 2 more

My local environment was:

  • Java 8u181
  • Maven 3.5.3
  • mvn clean install

Any proposal what I can do on my side to investigate?

@marchof
Copy link
Member

marchof commented Aug 24, 2019

In line 94 of maven.htmlthere I found one more @substitution.

@Godin Godin force-pushed the fix_substitution branch from 2eb8bb4 to 7e14975 Compare August 24, 2019 19:06
@Godin
Copy link
Member Author

Godin commented Aug 24, 2019

In line 94 of maven.html there I found one more @ substitution.

Fixed and double-checked all remaining occurrences of regex @[a-z.]++@ and remaining ones in org.jacoco.examples/ and jacoco-maven-plugin.test/it/ do not require change.

When I run the build locally, replacement does not work at all
Any proposal what I can do on my side to investigate?

This is very weird - I just checked with Maven 3.5.3 and JDK 8u181 and it works on my side.
So for the time being I don't have ideas. Maybe you can try without Eclipse from command line after cleaning local Maven repository and with fresh clone into new directory

rm -rf ~/.m2/repository/org/jacoco/
git clone https://github.com/jacoco/jacoco.git
cd jacoco
mvn install

?

@Godin Godin force-pushed the fix_substitution branch from 7e14975 to 4283cc8 Compare August 24, 2019 19:39
@marchof
Copy link
Member

marchof commented Aug 25, 2019

@Godin Ok, I found the cause: When I build in ./org.jacoco.buildas working directory keyword replacement fails. When repo root ./ is the working directory (and I use /pom.xml) everything is good.

Do you wan't to investigate (and fix) this or do we require workspace root as working directory for build?

@Godin
Copy link
Member Author

Godin commented Aug 25, 2019

@marchof weird again, because

cd org.jacoco.build
mvn install

works for me. So my best wild guess remains the same - are you using Eclipse Maven Launcher or command line?

@marchof
Copy link
Member

marchof commented Aug 25, 2019

Looks like this some local problem on my side only.

@marchof
Copy link
Member

marchof commented Aug 25, 2019

@Godin Ok, looks like running Eclipse kicks-in and copies original resources to target.

@Godin Godin force-pushed the fix_substitution branch from 4283cc8 to b989c4f Compare August 25, 2019 17:26
`org.jacoco.ant` module uses `maven-bundle-plugin` which requires
usage of `${...}` pattern, so for consistency also use it everywhere.
@Godin Godin force-pushed the fix_substitution branch from b989c4f to 00ba132 Compare August 25, 2019 17:29
@marchof marchof merged commit 865fb1c into master Aug 25, 2019
@marchof marchof deleted the fix_substitution branch August 25, 2019 18:04
@jacoco jacoco locked as resolved and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Keywords in org.jacoco.ant/about.html not expanded
2 participants