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

ASF GitHub Bot commented on MJAR-260:
-------------------------------------

sormuras commented on a change in pull request #3: [MJAR-260] Fail on invalid 
automatic module name
URL: https://github.com/apache/maven-jar-plugin/pull/3#discussion_r234218920
 
 

 ##########
 File path: src/test/java/org/apache/maven/plugins/jar/AbstractJarMojoTest.java
 ##########
 @@ -0,0 +1,51 @@
+package org.apache.maven.plugins.jar;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test for {@link AbstractJarMojo}
+ */
+public class AbstractJarMojoTest
+{
+    @Test
+    public void testInvalidModuleNames()
+    {
+        assertFalse( AbstractJarMojo.isValidModuleName( "" ) );
+        assertFalse( AbstractJarMojo.isValidModuleName( "." ) );
+        assertFalse( AbstractJarMojo.isValidModuleName( "_" ) );
+        assertFalse( AbstractJarMojo.isValidModuleName( "dash-is-invalid" ) );
+        assertFalse( AbstractJarMojo.isValidModuleName( "new.class" ) );
 
 Review comment:
   Will update those and more samples later today.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Warn about invalid 'Automatic-Module-Name' in MANIFEST
> ------------------------------------------------------
>
>                 Key: MJAR-260
>                 URL: https://issues.apache.org/jira/browse/MJAR-260
>             Project: Maven JAR Plugin
>          Issue Type: Improvement
>            Reporter: Christian Stein
>            Assignee: Christian Stein
>            Priority: Minor
>
> The Maven JAR Plugin should warn or even fail when an invalid name is 
> detected within the `META-INF/MANIFEST.MF` file.
> For details seeĀ 
> https://sormuras.github.io/blog/2018-11-16-invalid-automatic-module-names



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

Reply via email to