[jira] [Created] (MPMD-392) Allow skip maven toolchain configuration

2024-03-08 Thread Roberto Araujo (Jira)
Roberto Araujo created MPMD-392:
---

 Summary: Allow skip maven toolchain configuration
 Key: MPMD-392
 URL: https://issues.apache.org/jira/browse/MPMD-392
 Project: Maven PMD Plugin
  Issue Type: New Feature
Reporter: Roberto Araujo


I think it's a good idea allow skip the usage of maven toolchain, let me give 
my use case:

I'm working on a "legacy" java application. The application is compiled 
targeting Java 6. Our build requires Java 17, so we are using the JDK 6 
toolchain (via Maven Toolchain plugin) to compile the source code (Note that 
Java 17 compiler can't target Java 6 bytecode).

The problem is that PMD Plugin will use the configured toolchain. Obviously, 
the latest version is not compatible with Java 6 so the execution fails with  
the following exception:

```
Exception in thread "main" java.lang.UnsupportedClassVersionError: 
org/apache/maven/plugins/pmd/exec/PmdExecutor : Unsupported major.minor version 
52.0
```

One option is to configure a new toolchain just to  PMD plugin and use the 
``option 
(https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html#jdkToolchain). 
A Much more portable solution is to skip the usage of configured toolchain, so 
we don't depend of the `settings.xml` file.


If this makes sense, I can try to work on it and fire a PR on the GitHub 
repository.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJLINK-6) Allow set the jmods path

2019-06-10 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJLINK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16860184#comment-16860184
 ] 

Roberto Araujo commented on MJLINK-6:
-

Tested and is working fine. Tested in Linux (Travis CI) and macOS (my machine) 
with Java 9, 10, 11 and 12

 

My suggestion is also to include an WARN log when the `sourceJdkModules` folder 
is invalid. Note that in case we use an invalid folder we will fallback to the 
folder based on `jlink` binary location and the user will not notice the 
problem. (happened to me)

 

Example project with success use: 
[https://github.com/andrioli/maven-jlink-docker-example]

 

Thanks

> Allow set the jmods path
> 
>
> Key: MJLINK-6
> URL: https://issues.apache.org/jira/browse/MJLINK-6
> Project: Maven JLink Plugin
>  Issue Type: Improvement
>Reporter: Roberto Araujo
>Assignee: Robert Scholte
>Priority: Minor
>  Labels: up-for-grabs
> Fix For: 3.0.0-alpha-2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The current version of the plugin hard-coded the `jmods` folder (based on 
> `jlink` binary location).  But, for instance, if I want to build a runtime 
> image for Linux running the build in a OSX the runtime image will not be 
> compatible.
> I suggest to allow users define the JDK `jmods` folder, and if nothing is 
> set, use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJAR-238) Allow setting of module main class

2019-02-19 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJAR-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16772364#comment-16772364
 ] 

Roberto Araujo commented on MJAR-238:
-

I just tested it and is working fine.

> Allow setting of module main class
> --
>
> Key: MJAR-238
> URL: https://issues.apache.org/jira/browse/MJAR-238
> Project: Maven JAR Plugin
>  Issue Type: Improvement
> Environment: Java9 build 9+176, MacOS
>Reporter: Machiel Groeneveld
>Assignee: Enrico Olivelli
>Priority: Minor
> Fix For: 3.1.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a Java9 module is created using the maven-jar plugin, setting the 
> manifest/mainclass does not set the module main class. Therefore the module 
> is not executable without specifying the main class. Executing the module 
> using java -m domain.app gives the following error:
> _module jigsaw.app does not have a MainClass attribute_
> According to the module specification a module (jar) can have a main class 
> set. If I understand correctly it's inside the module-info.class as a 
> property called ModuleMainClass
> When using the JDK9 jar command it will update the jar and the 
> module-info.class.
> {noformat}
>   -e, --main-class=CLASSNAME The application entry point for stand-alone
>  applications bundled into a modular, or 
> executable,
>  jar archive
> {noformat}
> I guess it would make sense to have this as a separate configuration item 
> since the mainclass entry in the manifest file is not needed in 'module mode' 
> and vice versa.
> If this is a duplicate of another issue, please close this one, I couldn't 
> find any existing issues related to this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJAR-238) Allow setting of module main class

2019-02-14 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJAR-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16768905#comment-16768905
 ] 

Roberto Araujo commented on MJAR-238:
-

I know that I can install the plug-in locally, but I want to test this feature 
along with MJLINK-6 in CI environment (e.g., Travis, AppVeyor and Jenkins). 
Will be much easier download the compiled binaries from a repository

> Allow setting of module main class
> --
>
> Key: MJAR-238
> URL: https://issues.apache.org/jira/browse/MJAR-238
> Project: Maven JAR Plugin
>  Issue Type: Improvement
> Environment: Java9 build 9+176, MacOS
>Reporter: Machiel Groeneveld
>Assignee: Enrico Olivelli
>Priority: Minor
> Fix For: 3.1.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a Java9 module is created using the maven-jar plugin, setting the 
> manifest/mainclass does not set the module main class. Therefore the module 
> is not executable without specifying the main class. Executing the module 
> using java -m domain.app gives the following error:
> _module jigsaw.app does not have a MainClass attribute_
> According to the module specification a module (jar) can have a main class 
> set. If I understand correctly it's inside the module-info.class as a 
> property called ModuleMainClass
> When using the JDK9 jar command it will update the jar and the 
> module-info.class.
> {noformat}
>   -e, --main-class=CLASSNAME The application entry point for stand-alone
>  applications bundled into a modular, or 
> executable,
>  jar archive
> {noformat}
> I guess it would make sense to have this as a separate configuration item 
> since the mainclass entry in the manifest file is not needed in 'module mode' 
> and vice versa.
> If this is a duplicate of another issue, please close this one, I couldn't 
> find any existing issues related to this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJLINK-6) Allow set the jmods path

2019-02-14 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJLINK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16768581#comment-16768581
 ] 

Roberto Araujo commented on MJLINK-6:
-

Can you guys release a SNAPSHOT version? So I can test it.

> Allow set the jmods path
> 
>
> Key: MJLINK-6
> URL: https://issues.apache.org/jira/browse/MJLINK-6
> Project: Maven JLink Plugin
>  Issue Type: Improvement
>Reporter: Roberto Araujo
>Assignee: Robert Scholte
>Priority: Minor
>  Labels: up-for-grabs
> Fix For: 3.0.0-alpha-2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The current version of the plugin hard-coded the `jmods` folder (based on 
> `jlink` binary location).  But, for instance, if I want to build a runtime 
> image for Linux running the build in a OSX the runtime image will not be 
> compatible.
> I suggest to allow users define the JDK `jmods` folder, and if nothing is 
> set, use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJAR-238) Allow setting of module main class

2019-02-14 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJAR-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16768587#comment-16768587
 ] 

Roberto Araujo commented on MJAR-238:
-

can you guys release a SNAPSHOT version? So I can test it.

> Allow setting of module main class
> --
>
> Key: MJAR-238
> URL: https://issues.apache.org/jira/browse/MJAR-238
> Project: Maven JAR Plugin
>  Issue Type: Improvement
> Environment: Java9 build 9+176, MacOS
>Reporter: Machiel Groeneveld
>Assignee: Enrico Olivelli
>Priority: Minor
> Fix For: 3.1.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a Java9 module is created using the maven-jar plugin, setting the 
> manifest/mainclass does not set the module main class. Therefore the module 
> is not executable without specifying the main class. Executing the module 
> using java -m domain.app gives the following error:
> _module jigsaw.app does not have a MainClass attribute_
> According to the module specification a module (jar) can have a main class 
> set. If I understand correctly it's inside the module-info.class as a 
> property called ModuleMainClass
> When using the JDK9 jar command it will update the jar and the 
> module-info.class.
> {noformat}
>   -e, --main-class=CLASSNAME The application entry point for stand-alone
>  applications bundled into a modular, or 
> executable,
>  jar archive
> {noformat}
> I guess it would make sense to have this as a separate configuration item 
> since the mainclass entry in the manifest file is not needed in 'module mode' 
> and vice versa.
> If this is a duplicate of another issue, please close this one, I couldn't 
> find any existing issues related to this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJLINK-6) Allow set the jmods path

2018-06-30 Thread Roberto Araujo (JIRA)


[ 
https://issues.apache.org/jira/browse/MJLINK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16528809#comment-16528809
 ] 

Roberto Araujo commented on MJLINK-6:
-

[~sellersj] this is exactly my use case

> Allow set the jmods path
> 
>
> Key: MJLINK-6
> URL: https://issues.apache.org/jira/browse/MJLINK-6
> Project: Maven JLink Plugin
>  Issue Type: Improvement
>Affects Versions: 3.0.0-alpha-2
>Reporter: Roberto Araujo
>Priority: Minor
>
> The current version of the plugin hard-coded the `jmods` folder (based on 
> `jlink` binary location).  But, for instance, if I want to build a runtime 
> image for Linux running the build in a OSX the runtime image will not be 
> compatible.
> I suggest to allow users define the JDK `jmods` folder, and if nothing is 
> set, use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJAR-238) Allow setting of module main class

2018-05-17 Thread Roberto Araujo (JIRA)

[ 
https://issues.apache.org/jira/browse/MJAR-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16479507#comment-16479507
 ] 

Roberto Araujo commented on MJAR-238:
-

Can I help with this issue? If so, how can I proceed?

> Allow setting of module main class
> --
>
> Key: MJAR-238
> URL: https://issues.apache.org/jira/browse/MJAR-238
> Project: Maven JAR Plugin
>  Issue Type: Improvement
> Environment: Java9 build 9+176, MacOS
>Reporter: Machiel Groeneveld
>Assignee: Robert Scholte
>Priority: Minor
>
> When a Java9 module is created using the maven-jar plugin, setting the 
> manifest/mainclass does not set the module main class. Therefore the module 
> is not executable without specifying the main class. Executing the module 
> using java -m domain.app gives the following error:
> _module jigsaw.app does not have a MainClass attribute_
> According to the module specification a module (jar) can have a main class 
> set. If I understand correctly it's inside the module-info.class as a 
> property called ModuleMainClass
> When using the JDK9 jar command it will update the jar and the 
> module-info.class.
> {noformat}
>   -e, --main-class=CLASSNAME The application entry point for stand-alone
>  applications bundled into a modular, or 
> executable,
>  jar archive
> {noformat}
> I guess it would make sense to have this as a separate configuration item 
> since the mainclass entry in the manifest file is not needed in 'module mode' 
> and vice versa.
> If this is a duplicate of another issue, please close this one, I couldn't 
> find any existing issues related to this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJLINK-6) Allow set the jmods path

2018-05-17 Thread Roberto Araujo (JIRA)

[ 
https://issues.apache.org/jira/browse/MJLINK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16479508#comment-16479508
 ] 

Roberto Araujo commented on MJLINK-6:
-

Can I help with this issue? If so, how can I proceed?

> Allow set the jmods path
> 
>
> Key: MJLINK-6
> URL: https://issues.apache.org/jira/browse/MJLINK-6
> Project: Maven JLink Plugin
>  Issue Type: Improvement
>Affects Versions: 3.0.0-alpha-2
>Reporter: Roberto Araujo
>Priority: Minor
>
> The current version of the plugin hard-coded the `jmods` folder (based on 
> `jlink` binary location).  But, for instance, if I want to build a runtime 
> image for Linux running the build in a OSX the runtime image will not be 
> compatible.
> I suggest to allow users define the JDK `jmods` folder, and if nothing is 
> set, use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MJLINK-6) Allow set the jmods path

2017-11-24 Thread Roberto Araujo (JIRA)

[ 
https://issues.apache.org/jira/browse/MJLINK-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16265399#comment-16265399
 ] 

Roberto Araujo commented on MJLINK-6:
-

But I can build a runtime image for Linux on OS X (At least for a docker 
containers). E.g., If I use the `--module-path` option the `jmod` folder from 
the Linux distribution (available at http://jdk.java.net/9/) the assembled 
runtime image will work on Docker container (tested with debian:sid). But if I 
use the `jmod` folder from my JAVA_HOME (i'm on OS X) the assembled runtime 
image will not work in the container (the binaries are not compatible).

> Allow set the jmods path
> 
>
> Key: MJLINK-6
> URL: https://issues.apache.org/jira/browse/MJLINK-6
> Project: Maven JLink Plugin
>  Issue Type: Improvement
>Affects Versions: 3.0.0-alpha-2
>Reporter: Roberto Araujo
>Priority: Minor
>
> The current version of the plugin hard-coded the `jmods` folder (based on 
> `jlink` binary location).  But, for instance, if I want to build a runtime 
> image for Linux running the build in a OSX the runtime image will not be 
> compatible.
> I suggest to allow users define the JDK `jmods` folder, and if nothing is 
> set, use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (MJLINK-6) Allow set the jmods path

2017-11-23 Thread Roberto Araujo (JIRA)
Roberto Araujo created MJLINK-6:
---

 Summary: Allow set the jmods path
 Key: MJLINK-6
 URL: https://issues.apache.org/jira/browse/MJLINK-6
 Project: Maven JLink Plugin
  Issue Type: Improvement
Affects Versions: 3.0.0-alpha-2
Reporter: Roberto Araujo
Priority: Minor


The current version of the plugin hard-coded the `jmods` folder (based on 
`jlink` binary location).  But, for instance, if I want to build a runtime 
image for Linux running the build in a OSX the runtime image will not be 
compatible.

I suggest to allow users define the JDK `jmods` folder, and if nothing is set, 
use the one based on the JAVA_HOME/Toolchain configuration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)