Build Tools and Package Manager

By akohad Apr26,2023

[ad_1]

What are Build and package managers tools?

What Kind of format do these artifacts have?

The artifact file looks different for each programming language. For example, java has the artifacts of format JAR (Java Archive) or WAR file, it includes whole code plus dependencies like spring framework, DateTime libraries etc.

How to Build the artifacts?

These are built using specific tools. Which are specific to the programming language. For example, for Java, it’s Maven or Gradle.

mvn install

How to run the application?

After the artifact is been made and deployed on the fresh server use the following command.

java -jar <name of jar file>

What about JS Applications?

following command is used for installing dependencies .

-> npm install

npm start -> start the application
npm stop -> stop the application
npm test -> runt the test
npm publish -> publish the artifact

What if the project is using React in the front end and Java in the back end, How to build the artifact then?

We can then build the artifact in two ways:-

What if the project is using React in the front end and NodeJs in the back end, How to build the artifact then?

As both are JS libraries we can then build the artifact in two ways:-

Frontend/React Code needs to be transpiled!

Transpiled means to make your js code browser readable as the browser does not support the latest JS version or other fancy code decorations, like JSX. The code needs to be compressed/minified! Separate tools are there for that — Build tools/Bundlers! An example is “WebPack”.

first install all the dependencies of the project .
-> cd api
-> npm install

Then use the run command
-> npm run build

server.bundle.js name file will be created in the node_moduled folder.
This will be the compiled and compressed code.

Package Frontend Code (when JAVA is the back end)

  1. Bundle frontend App with Webpack
  2. Manage dependencies with npm or yarn
  3. Package everything into a WAR file

Build tools and Docker

[ad_2]

Source link

By akohad

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *