Skip to content
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

Move BuildProperties to the client #630

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<configuration>
<locale>en_US</locale>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-lifecycle-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mvndaemon.mvnd.common;
package org.mvndaemon.mvnd.client;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.mvndaemon.mvnd.common.BuildProperties;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.Os;
import org.mvndaemon.mvnd.common.SocketFamily;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.fusesource.jansi.internal.CLibrary;
import org.jline.utils.AttributedString;
import org.jline.utils.AttributedStyle;
import org.mvndaemon.mvnd.common.BuildProperties;
import org.mvndaemon.mvnd.common.DaemonException;
import org.mvndaemon.mvnd.common.DaemonInfo;
import org.mvndaemon.mvnd.common.DaemonRegistry;
Expand Down Expand Up @@ -187,11 +186,10 @@ public ExecutionResult execute(ClientOutput output, List<String> argv) {
if (version || showVersion || debug) {
// Print mvnd version
BuildProperties buildProperties = BuildProperties.getInstance();
final String mvndVersionString = "mvnd "
+ (Environment.isNative() ? "native client " : "JVM client ")
+ buildProperties.getVersion()
+ "-" + buildProperties.getOsName()
+ "-" + buildProperties.getOsArch()
final String mvndVersionString = "mvnd " + buildProperties.getVersion() + " "
+ (Environment.isNative()
? buildProperties.getOsName() + "-" + buildProperties.getOsArch() + " native client"
: "JVM client")
+ " (" + buildProperties.getRevision() + ")";

boolean isColored = !"never".equals(Environment.MAVEN_COLOR.getCommandLineOption(args));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

revision=${buildNumber}
timestamp=${timestamp}
version=${project.version}
os.detected.name=${os.detected.name}
os.detected.arch=${os.detected.arch}
22 changes: 0 additions & 22 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,7 @@
</dependencies>

<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<configuration>
<locale>en_US</locale>
<timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssX}</timestampFormat>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mvndaemon.mvnd</groupId>
<artifactId>mvnd-build-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ void version() throws IOException, InterruptedException {
client.execute(output, "-v").assertSuccess();

output.assertContainsMatchingSubsequence(
"\\Qmvnd " + (isNative() ? "native client " : "JVM client ")
"\\Qmvnd "
+ System.getProperty("project.version")
+ "-" + System.getProperty("os.detected.name")
+ "-" + System.getProperty("os.detected.arch")
+ " "
+ (isNative()
? System.getProperty("os.detected.name")
+ "-" + System.getProperty("os.detected.arch") + " native client"
: "JVM client")
+ "\\E",
"\\QMaven home: " + parameters.mvndHome() + "\\E");
}
Expand Down