Skip to content

Commit

Permalink
[#9918] Support version like patch form
Browse files Browse the repository at this point in the history
I have checked that an error occurs when running with agent of latest released 2.5.1-p1 version.

```
java.lang.IllegalStateException: pinpoint-bootstrap-x.x.x(-SNAPSHOT)(-RCx).jar not found.
	at com.navercorp.pinpoint.bootstrap.agentdir.AgentDirBaseClassPathResolver.resolve(AgentDirBaseClassPathResolver.java:73)
	at com.navercorp.pinpoint.bootstrap.PinpointBootStrap.resolveAgentDir(PinpointBootStrap.java:132)
	at com.navercorp.pinpoint.bootstrap.PinpointBootStrap.start(PinpointBootStrap.java:100)
```

It seems that the version like patch from (-p1) is not supported, I have fixed it.
  • Loading branch information
koo-taejin authored and emeroad committed May 3, 2023
1 parent d62304b commit 721abe3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AgentDirBaseClassPathResolver implements ClassPathResolver {

private final BootLogger logger = BootLogger.getLogger(this.getClass());

static final String VERSION_PATTERN = "(-[0-9]+\\.[0-9]+\\.[0-9]+((\\-SNAPSHOT)|(-RC[0-9]+))?)?";
static final String VERSION_PATTERN = "(-[0-9]+\\.[0-9]+\\.[0-9]+((\\-SNAPSHOT)|(-RC[0-9]+)|(-p[0-9]+))?)?";

static final JarDescription bootstrap = new JarDescription("pinpoint-bootstrap", true);
private static final String EXTENSIONS = "*.{jar,xml,properties}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/
public class JarDescription {

static final String VERSION_PATTERN = "(-[0-9]+\\.[0-9]+\\.[0-9]+((\\-SNAPSHOT)|(-RC[0-9]+))?)?";
static final String SIMPLE_PATTERN = "-x.x.x(-SNAPSHOT)(-RCx)";
static final String VERSION_PATTERN = "(-[0-9]+\\.[0-9]+\\.[0-9]+((\\-SNAPSHOT)|(-RC[0-9]+)|(-p[0-9]+))?)?";
static final String SIMPLE_PATTERN = "-x.x.x(-SNAPSHOT)(-RCx)(-px)";

private final String prefix;
private final boolean required;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testVersion() {
assertVersion("-1.6.0-RC0");
assertVersion("-1.6.0-RC11");


assertVersion("-2.5.1-p1");
}

@Test
Expand Down

0 comments on commit 721abe3

Please sign in to comment.